From 80ceca14b5e7df8672c212bf82e2f21ce4692e02 Mon Sep 17 00:00:00 2001 From: Bryan Petty Date: Sun, 15 Nov 2015 22:19:28 -0700 Subject: [PATCH] Backport release script updates to 3.0. --- build/tools/bld_chm_exe.bat | 82 ---------------- build/tools/git-make-release | 89 ----------------- build/tools/make-html-docs | 30 ------ build/tools/release.bat | 71 ++++++++++++++ build/tools/release.sh | 71 ++++++++++++++ build/tools/svn-find-native-eols.pl | 36 ------- build/tools/wxwidgets.iss | 6 +- docs/tech/tn0022.txt | 145 ++++++++++------------------ 8 files changed, 198 insertions(+), 332 deletions(-) delete mode 100644 build/tools/bld_chm_exe.bat delete mode 100755 build/tools/git-make-release delete mode 100755 build/tools/make-html-docs create mode 100644 build/tools/release.bat create mode 100755 build/tools/release.sh delete mode 100755 build/tools/svn-find-native-eols.pl diff --git a/build/tools/bld_chm_exe.bat b/build/tools/bld_chm_exe.bat deleted file mode 100644 index 760c54386e..0000000000 --- a/build/tools/bld_chm_exe.bat +++ /dev/null @@ -1,82 +0,0 @@ -rem Uncomment the next line to set the version; used also in wxWidgets.iss -SET WXW_VER=3.0.3 -if (%WXW_VER%)==() SET WXW_VER=SVN - -echo docs building for %WXW_VER% - -rem This builds the docs in %WXWIN% in a number of formats -rem and a clean inno setup in a second tree -rem it uses a number of tools, gnuwin32 zip & dos2unix, -rem writes a log file in c:\ - -echo Building wxWidgets-%WXW_VER% docs... > c:\temp.log - -set WXWIN=c:\wx\wxWidgets -set DAILY=c:\daily -set INNO=c:\wx\inno\wxWidgets - -rem svn already in my path... -set PATH=%PATH%;c:\wx\Gnu\bin;c:\progra~1\htmlhe~1;C:\PROGRA~1\INNOSE~1;c:\wx\doxygen\bin -set PATH=%PATH%;C:\wx\Graphviz\bin -echo %PATH% >> c:\temp.log - - -rem update wxwidgets (holds docs) and inno (wxMSW setup.exe only) -c: -cd %WXWIN% -svn cleanup >> c:\temp.log -svn up >> c:\temp.log - -rem now inno -cd %INNO% >> c:\temp.log -rem Don't update the svn automatically -rem svn cleanup >> c:\temp.log -rem svn up >> c:\temp.log - -if exist include\wx\msw\setup.h del include\wx\msw\setup.h -if exist include\wx\univ\setup.h del include\wx\univ\setup.h - -del c*.* -svn up configure -svn up configure.in -svn up config.guess -svn up config.sub -dos2unix configure -dos2unix config.guess -dos2unix config.sub -copy include\wx\msw\setup0.h include\wx\msw\setup.h -copy include\wx\univ\setup0.h include\wx\univ\setup.h -echo SVN update >> c:\temp.log - -rem make chm -rem Now create standalone copies of docs (chm and htb) -cd %WXWIN%\docs\doxygen -del out\html\*.html -del out\html\*.htb -del out\html\*.zip -del out\*.chm -call regen chm - - -cd %WXWIN%\docs\doxygen\out -zip wxWidgets-%WXW_VER%-docs-chm.zip wx.chm -copy wxWidgets-%WXW_VER%-docs-chm.zip %DAILY% -cd html -del *.dot -del *.md5 -zip -r wx.htb *.* -copy wx.htb %DAILY%\wxWidgets-%WXW_VER%-docs-html.zip -zip wxWidgets-%WXW_VER%-docs-htb.zip wx.htb -copy wxWidgets-%WXW_VER%-docs-htb.zip %DAILY% - - -mkdir %INNO%\docs\htmlhelp -copy %WXWIN%\docs\doxygen\out\wx.chm %INNO%\docs\htmlhelp\wx.chm -cd %WXWIN%\build\tools -iscc wxwidgets.iss >> c:\temp.log -copy %INNO%\..\wxMSW-%WXW_VER%-Setup.exe c:\daily - -echo docs built for %WXW_VER% -echo docs built for %WXW_VER% >> c:\temp.log - - diff --git a/build/tools/git-make-release b/build/tools/git-make-release deleted file mode 100755 index 5a0df86511..0000000000 --- a/build/tools/git-make-release +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# -# This is the script used by VZ to make wxWidgets releases. It is unofficial -# because it must be ran from git-svn repository and not the official svn one -# and relies on having a recent Perl installation. But it has the advantage of -# being very simple because git knows which files should be included in the -# distribution and we don't need to maintain the list of them ourselves but we -# also don't run the risk of including anything unwanted. -# -# Another prerequisite for using it is to create the list of files to be -# converted to DOS EOLs for Windows distribution, it must exist in the parent -# directory and be called eol-native. This can be done using the companion -# svn-find-native-eols.pl script. And will only need to be redone when -# svn:eol-style property changes for any files (most likely because it will be -# set for a newly added file). -# -# To summarize, here are the steps to create the release: -# -# % cd $svn -# % $git/build/tools/svn-find-native-eols.pl > $git/../eol-native -# % cd $git -# % git svn tag WX_x_y_z -# % ./build/tools/git-make-release x.y.z -# % ... upload ../wxWidgets-x.y.z.{7z,tar.bz2,zip} ... -# -# If anything is wrong and some minor fixes are required, only the last two -# steps (tagging and git-make-release) must be repeated. - -version=$1 -if [ -z "$version" ]; then - echo "Must specify the distribution version." >&2 - exit 1 -fi - -EOL_FILE=../eol-native -if [ ! -r "$EOL_FILE" ]; then - echo "Use build/tools/svn-find-native-eols.pl to generate $EOL_FILE." >&2 - exit 1 -fi - -if ! git diff --quiet; then - echo "Working copy has modifications, commit or stash them." >&2 - exit 2 -fi - -set -e -set -x - -prefix=wxWidgets-$version -destdir=$(dirname $(readlink -f $0))/../../../$prefix - -cleanup() { - rm -rf $destdir -} - -trap cleanup INT TERM EXIT - -cleanup - -git archive --prefix=$prefix/ HEAD | (cd ..; tar x) -cd .. -# All setup0.h files are supposed to be renamed to just setup.h when checked -# out and in the distribution. -find $prefix/include/wx -type f -name setup0.h | while read f; do - mv $f ${f%0.h}.h -done - -# Compile gettext catalogs. -make -C $prefix/locale allmo - -tar cjf $prefix.tar.bz2 $prefix - -cd $prefix -set +x -for f in `cat $EOL_FILE`; do - case $f in - */setup0.h) - # we renamed this file above so adjust - f=${f%0.h}.h - ;; - esac - unix2dos -q $f -done -set -x - -zip -q -r ../$prefix.zip . - -7z a ../$prefix.7z . >/dev/null -7z a ../${prefix}_headers.7z include >/dev/null diff --git a/build/tools/make-html-docs b/build/tools/make-html-docs deleted file mode 100755 index 771b67e88f..0000000000 --- a/build/tools/make-html-docs +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# This script creates archives of HTML documentation in tar.bz2 and zip -# formats. It relies on docs/doxygen/regen.sh to really generate the docs. -# -# The script should be ran from the root of wxWidgets checkout and creates the -# output files in its parent directory. - -version=$1 -if [ -z "$version" ]; then - echo "Must specify the distribution version." >&2 - exit 1 -fi - -set -e -set -x - -docs_dir_name=wxWidgets-$version -docs_file_basename=wxWidgets-$version-docs-html - -cd docs/doxygen -./regen.sh html -cd out -mv html $docs_dir_name -tar cjf ../../../../$docs_file_basename.tar.bz2 $docs_dir_name -cd $docs_dir_name -zip -q -r ../../../../../$docs_file_basename.zip . - -cd .. -mv $docs_dir_name html diff --git a/build/tools/release.bat b/build/tools/release.bat new file mode 100644 index 0000000000..4c4eacb3d5 --- /dev/null +++ b/build/tools/release.bat @@ -0,0 +1,71 @@ +@echo off +setlocal enabledelayedexpansion + +rem This script builds the CHM manual and the Windows installer for release. + +if "%1" == "" ( + echo You must specify a release version. + exit /b 1 +) + +pushd "%~dp0..\.." + +set root=%cd% +set version=%1 +set prefix=wxWidgets-%1 +set release_path=%root%\distrib\release\%version% + +where /q 7z +if %ERRORLEVEL% neq 0 ( + echo Error: 7-Zip was not found in your PATH. + exit /b 1 +) +where /q dot +if %ERRORLEVEL% neq 0 ( + echo Error: GraphViz was not found in your PATH. + exit /b 1 +) +where /q doxygen +if %ERRORLEVEL% neq 0 ( + echo Error: Doxygen was not found in your PATH. + exit /b 1 +) +where /q hhc +if %ERRORLEVEL% neq 0 ( + echo Error: HTML Help Workshop was not found in your PATH. + exit /b 1 +) +where /q iscc +if %ERRORLEVEL% neq 0 ( + echo Error: Inno Setup was not found in your PATH. + exit /b 1 +) + +if not exist "%release_path%\%prefix%.zip" ( + echo Error: Release ZIP package not found: %release_path%\%prefix%.zip + exit /b 1 +) + +pushd "%root%\docs\doxygen" +echo Building the CHM manual... +call regen.bat chm +if %errorlevel% neq 0 exit /b %errorlevel% +copy out\wx.chm "%release_path%\%prefix%.chm" +popd + +if exist "%release_path%\%prefix%" rd /s /q "%release_path%\%prefix%" +md "%release_path%\%prefix%" +pushd "%release_path%\%prefix%" +echo Extracting release ZIP for installer... +7z x "..\%prefix%.zip" +if %errorlevel% neq 0 exit /b %errorlevel% +md docs\htmlhelp +copy "..\%prefix%.chm" docs\htmlhelp\wx.chm +set WXW_VER=%1 +echo Building the installer... +iscc /Qp build\tools\wxwidgets.iss +if %errorlevel% neq 0 exit /b %errorlevel% +popd + +echo Cleaning up installer files... +rd /s /q "%release_path%\%prefix%" diff --git a/build/tools/release.sh b/build/tools/release.sh new file mode 100755 index 0000000000..1cae6af952 --- /dev/null +++ b/build/tools/release.sh @@ -0,0 +1,71 @@ +#!/bin/sh +# +# This is the official script used to make wxWidgets releases. +# +# We use the git export features to track which files should be included in the +# distribution and we don't need to maintain the list of them ourselves but we +# also don't run the risk of including anything unwanted. +# +# See docs/tech/tn0022.txt for usage instructions. + +version=$1 +if [ -z "$version" ]; then + echo "Must specify the distribution version." >&2 + exit 1 +fi + +root="$(readlink -f $(dirname $(readlink -f $0))/../..)" +cd "$root" + +if ! git diff --quiet; then + echo "Working copy has modifications, commit or stash them." >&2 + exit 2 +fi + +set -e +set -x + +prefix=wxWidgets-$version +destdir="$root/distrib/release/$version" + +cleanup() { + rm -rf $destdir/$prefix +} + +trap cleanup INT TERM EXIT + +cleanup + +mkdir -p $destdir +git archive --prefix=$prefix/ HEAD | (cd $destdir; tar x) +cd $destdir +# All setup0.h files are supposed to be renamed to just setup.h when checked +# out and in the distribution. +find $prefix/include/wx -type f -name setup0.h | while read f; do + mv $f ${f%0.h}.h +done + +# Compile gettext catalogs. +make -C $prefix/locale allmo + +tar cjf $prefix.tar.bz2 $prefix + +cd $prefix + +zip -q -r ../$prefix.zip . + +7z a ../$prefix.7z . >/dev/null +7z a ../${prefix}-headers.7z include >/dev/null + +# Build HTML documentation packages. +prefix_docs=$prefix-docs-html +cd "$root/docs/doxygen" +rm -rf out +./regen.sh html +cd out +mv html "$prefix_docs" +tar cjf "$destdir/$prefix_docs.tar.bz2" "$prefix_docs" +cd "$prefix_docs" +zip -q -r "$destdir/$prefix_docs.zip" . +cd "$root" +rm -rf "$root/docs/doxygen/out" diff --git a/build/tools/svn-find-native-eols.pl b/build/tools/svn-find-native-eols.pl deleted file mode 100755 index d9a2d9110c..0000000000 --- a/build/tools/svn-find-native-eols.pl +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl -# -# This script produces the list of all files using native svn:eol-style. -# -# It's used as a helper for distribution creation as this is also the -# list of files which need to have their line endings converted for -# the use on the platform other than the current one. -# -# Notice that the script requires Perl 5.10 (which could be easily avoided but -# as this is for my personal use mostly so far, I didn't bother) and Perl svn -# bindings. -use 5.10.0; -use strict; -use warnings; -use SVN::Client; - -# Normally we get the list directly from the server but this is slow, -# so if you already have an (up to date!) svn checkout, you can also -# pass a path to it here, the script will work much faster then. -my $root = $ARGV[0] // 'https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk'; - -my $ctx = SVN::Client->new - or die "Failed to create svn context, do you have svn auth stored?\n"; - -my $props = $ctx->proplist($root, undef, 1) - or die "Failed to list properties for files under $root.\n"; - -foreach my $prop (@$props) { - my $eol = ${$prop->prop_hash()}{'svn:eol-style'}; - if ( defined $eol && ($eol eq 'native') ) { - my $rel = $prop->node_name(); - substr($rel, 0, length($root) + 1, ''); # +1 for leading slash - - say $rel; - } -} diff --git a/build/tools/wxwidgets.iss b/build/tools/wxwidgets.iss index 4fee20f424..6f95988d26 100644 --- a/build/tools/wxwidgets.iss +++ b/build/tools/wxwidgets.iss @@ -7,9 +7,9 @@ #define WXW_DIR "..\.." #endif -#if GetEnv("WXW_VER") == "SVN" - #define INFOFILE WXW_DIR + "\BuildSVN.txt" - #define WX_VERSION "SVN" +#if GetEnv("WXW_VER") == "Snapshot" + #define INFOFILE WXW_DIR + "\BuildSVN.txt" + #define WX_VERSION "Snapshot" #elif GetEnv("WXW_VER") != "" #define INFOFILE WXW_DIR + "\docs\msw\install.txt" #define WX_VERSION GetEnv("WXW_VER") diff --git a/docs/tech/tn0022.txt b/docs/tech/tn0022.txt index fead3c9a80..0d24b54bc1 100644 --- a/docs/tech/tn0022.txt +++ b/docs/tech/tn0022.txt @@ -1,101 +1,56 @@ - Making a new wxWidgets release - ============================== +Making a New wxWidgets Release +============================== -Before making the release -------------------------- +Creating a new release requires a few things before getting started: -Change the version in include/wx/version.h. +* Linux or OSX. +* Windows 7+ with HTML Help Workshop, and Inno Setup installed. +* 7-Zip, Doxygen 1.8.8, and GraphViz installed on both machines. -Update docs/readme.txt. Please review its contents in addition to just -changing the version number. +Unless mentioned otherwise, all steps should be run on Linux or OSX so that the +repository export used for the release is primarily using LF line endings. Files +that require CRLF line endings will be converted appropriately. -Put a date on the release line in docs/changes.txt. +*Important:* Ensure that 7-Zip, HTML Help Workshop, Doxygen, GraphViz and Inno +Setup have all been added to your Path in Windows. You can confirm this by +running `7z`, `hhc`, `iscc`, `doxygen -v`, and `dot -V` in a command prompt. +Add the missing installed folder locations of any executables to your Path. -Update the date in the manual (docs/doxygen/mainpages/manual.h). +Pre-Release Steps +----------------- -Update the release announcement post in docs/publicity/announce.txt. +* Change the version in `include/wx/version.h`. +* Update `docs/readme.txt`. Please review its contents in addition to just + changing the version number. +* Put a date on the release line in `docs/changes.txt`. +* Update the date in the manual (`docs/doxygen/mainpages/manual.h`). +* Update the release announcement post in `docs/publicity/announce.txt`. - -Creating release files +Creating Release Files ---------------------- -The currently used release scripts need to be used from git-svn checkout and -rely on Git to avoid problems with using non-clean trees and such. If you don't -use Git you may use the alternative archive creation scripts in the next -section. +The release scripts can be run from any working directory, and they will +generate all release package files under `distrib/release/x.y.z`. The scripts +build the release packages based on the current HEAD commit, so always +ensure you have the appropriate tag or commit checked out. -Follow these steps assuming the current working directory is the root of git -working copy and you want to prepare distribution for the version x.y.z: +1. Run `./build/tools/release.sh x.y.z` to create source archives + `wxWidgets-x.y.z.{7z,tar.bz2,zip}`, `wxWidgets-x.y.z-headers.7z`, and + `wxWidgets-x.y.z-docs-html.{tar.bz2,zip}` packages. -1. Run "./build/tools/svn-find-native-eols.pl > ../eol-native" (if you have - an existing svn checkout, pass it to the script to make it run much faster, - but take care to have up to date sources in the working tree). +2. Copy just the `wxWidgets-x.y.z.zip` package into the same + `distrib\release\x.y.z` folder on Windows. -2. Run "./build/tools/git-make-release x.y.z" to create source archives - ../wxWidgets-x.y.z.{7z,tar.bz2,zip} and wxWidgets_x.y.z_Headers.zip. - -3. Run "./build/tools/make-html-docs x.y.z" to create HTML documentation - archives ../wxWidgets-x.y.z.{tar.bz2,zip} - -4. This step must be done under Windows as it relies on having hhc.exe, the - Html Help compiler, in PATH: run the following commands - - cd docs\doxygen - regen.bat chm - cd out - zip ..\..\..\wxWidgets-x.y.z-docs-chm.zip wx.chm - -5. This step also must be done under Windows as it uses Inno Setup to produce - the .exe file and it also requires the CHM file built above: - - md x.y.z-sources - cd x.y.z-sources - 7z x ..\wxWidgets-x.y.z.7z - md docs\htmlhelp - cp ..\docs\doxygen\out\wx.chm docs\htmlhelp - set WXW_VER=x.y.z - iscc build\tools\wxwidgets.iss - - - -Instructions for the previous version of release scripts --------------------------------------------------------- - -NB: These scripts haven't been used since 2.8 series and may not work any longer! - -Currently our release system uses a Python 2.x script to generate releases. -The script requires Unix utilities such as tar, zip and unix2dos and thus must -be run either on Unix or using Cygwin on Windows. To generate a release, simply -run the following command: - -build/tools/create-archive.py --compression=all /path/to/output/dir - -This will produce zip, gzip and bzip archives of the tree (without -"compression" argument only .gz is made). Note that this commands produces huge -amounts of output so redirecting it to a file is recommended. - -To add a prefix to the release, such as RC1, the SVN revision, or a date, just -pass --postfix="postfix" to the script. More info on the options and their -possible values can be found by calling `create-archive.py --help`. - -IMPORTANT NOTE: You *must* run this script from a clean source tree, that is, - with no junk files in it or modifications. This is because the - release should be a pristine copy of the tree as of the time of - release. If you have legitimate modifications in the tree that need - to be in the release, commit them first. - -To generate the windows installer (.exe) and the documentation files (chm and htb formats) -run: - -build\tools\bld_chm_exe.bat - -which depends on the wxwidgets.iss file, and generates output in the %DAILY% directory. It -assumes a clean copy of the wxWidgets source tree in %INNO%. Temporary files will be generated -in the tree from which the batch file is run. It depends on doxygen, a number of gnu -win32 tools and Microsofts htmlhelp compiler. The wxwidgets.iss file should not need -editing, but you will want to check that the bld_chm_exe.bat has the correct version number. +3. Run `build/tools/release.bat x.y.z` in a Windows command prompt. +4. Copy these Windows packages back to your Linux or OSX `distrib/release/x.y.z` + directory so you can continue with the upload step with all packages + available: + ``` + wxMSW-x.y.z-Setup.exe + wxWidgets-x.y.z.chm + ``` Uploading --------- @@ -144,21 +99,27 @@ Create http://docs.wxwidgets.org/x.y.z/ (ask Bryan to do it if not done yet). Announcement ------------ -Post docs/publicity/announce.txt at least to wx-announce@googlegroups.com. +Update https://www.wxwidgets.org, usually a news item is enough but something +more can be called for for major releases. -Submit a link to http://www.reddit.com/r/programming +Post `docs/publicity/announce.txt` at least to wx-announce@googlegroups.com and +to wx-users for the important releases. -For major releases, submit the announcement to http://slashdot.org/submission +Submit a link to https://www.reddit.com/r/programming -Update www.wxwidgets.org, usually a news item is enough but something more can -be called for for major releases. +Submit to https://isocpp.org/blog/suggest -Also update downloads/index.html to mention the new latest release. +For major releases, submit the announcement to https://slashdot.org/submission + +Modify the links at downloads/index.html to point to the new release. Also +update the release date on this page. + +Also update docs/index.html for the minor or major (i.e. not micro) releases. Post to wxBlog if necessary. -Announce on Google+/Twitter/whatever the person doing the release prefers (we -don't have "official" wxWidgets account, should we?). +Create a new post on our official Google+ page here: +https://plus.google.com/+wxwidgets/ (contact Bryan for access) Version updates