4 # * Update configure.ac and possibly ChangeLog and
5 # src/sox.h (SOX_LIB_VERSION_CODE) to match release #. If this is a
6 # release candidate, add "rcN" to end of version in configure.ac.
7 # * Update date strings and possibly copyright years in man pages.
8 # * Tag files to release using following form: git tag sox-14.4.0rc1
10 # Automatable release steps. Most are optional but default to enabled.
12 # 1. Verify master git repo matches local git repo.
13 # 2. Build source packages.
14 # 3. Build Windows packages.
15 # 4. Generate announce email from NEWS file.
16 # 5. Build HTML and PDF documentation and upload to web site.
17 # 6. Create new release directory and upload packages to directory.
20 # * Make sure local tags get pushed remotely: git push --tags
21 # * Need to update sourceforge for recommended package to give to each
23 # * send announcement email using Mutt or similar (mutt -H sox-RELEASE.email).
24 # * Update front page of web site to point to latest files and give
26 # * Modify configure.ac, increment version # and put "git" at end of #.
32 Usage: `basename $0` [options] <tag_previous> <tag_current>
34 <tag_previous> can be special value "initial" when ran for first
38 --force force overwritting an existing release
39 --help this help message
40 --ignore-local-changes don't abort on uncommitted local changes
41 --no-build Skip building executable packages
42 --no-release Skip releasing files.
43 --no-short-log Put NEWS content into email instead of autogenerate.
44 --remote git remote where the change should be pushed (default "origin")
45 --user <name> username on $hostname
57 webpath
="sourceforge.net/projects/sox/files"
59 email_list
="sox-users@lists.sourceforge.net,sox-devel@lists.sourceforge.net"
60 hostname
="shell.sourceforge.net"
61 release_path
="/home/frs/project/sox"
63 web_path
="/home/project-web/sox/htdocs"
76 --ignore-local-changes)
103 echo "error: unknown option"
112 echo "error: unknown parameter"
120 # configure must have been ran to get release #.
121 [ ! -x configure
] && autoreconf
-i
122 [ ! -f Makefile
] && .
/configure
124 # Check if the object has been pushed. Do do so
125 # 1. Check if the current branch has the object. If not, abort.
126 # 2. Check if the object is on $remote/branchname. If not, abort.
127 local_sha
=`git rev-list -1 $tag_current`
128 current_branch
=`git branch | grep "\*" | sed -e "s/\* //"`
130 git rev-list
$current_branch |
grep $local_sha > /dev
/null
131 if [ $?
-eq 1 ]; then
132 echo "Cannot find tag '$tag_current' on current branch. Aborting."
133 echo "Switch to the correct branch and re-run the script."
137 revs
=`git rev-list $remote/$current_branch..$current_branch | wc -l`
138 if [ $revs -ne 0 ]; then
139 git rev-list
$remote/$current_branch..
$current_branch |
grep $local_sha > /dev
/null
141 if [ $?
-ne 1 ]; then
142 echo "$remote/$current_branch doesn't have object $local_sha"
143 echo "for tag '$tag_current'. Did you push branch first? Aborting."
149 module
="${tag_current%-*}"
150 if [ "x$module" = "x$tag_current" ]; then
151 # release-number-only tag.
153 module
=`basename $pwd`
154 release_num
="$tag_current"
156 # module-and-release-number style tag
157 release_num
="${tag_current##*-}"
160 detected_module
=`grep 'PACKAGE = ' Makefile | sed 's|PACKAGE = ||'`
161 if [ -f $detected_module-$release_num.
tar.bz2
]; then
162 module
=$detected_module
165 osx_zip
="$module-${release_num}-macosx.zip"
166 win_zip
="$module-${release_num}-win32.zip"
167 win_exe
="$module-${release_num}-win32.exe"
168 src_gz
="$module-${release_num}.tar.gz"
169 src_bz2
="$module-${release_num}.tar.bz2"
170 release_list
="$src_gz $src_bz2 $win_exe $win_zip $osx_zip"
172 email_file
="${module}-${release_num}.email"
176 echo "Creating source packages..."
177 ! make -s distcheck
&& echo "distcheck failed" && exit 1
178 ! make -s dist-bzip2
&& echo "dist-bzip2 failed" && exit 1
180 if [ $update_web = "yes" ]; then
181 echo "Creating HTML documentation for web site..."
182 ! make -s html
&& echo "html failed" && exit 1
184 echo "Creating PDF documentation for web site..."
185 ! make -s pdf
&& echo "pdf failed" && exit 1
188 echo "Creating Windows packages..."
195 MD5SUM
=`which md5sum || which gmd5sum`
196 SHA1SUM
=`which sha1sum || which gsha1sum`
201 Subject: [ANNOUNCE] SoX ${release_num} Released
204 The developers of SoX are happy to announce the release of SoX ${release_num}.
205 Thanks to all who contributed to this release.
209 if [ $short_log = "yes" ]; then
210 case "$tag_previous" in
215 range
="$tag_previous"..
"$tag_current"
218 echo "git tag: $tag_current"
220 git log
--no-merges "$range" | git shortlog
227 http://$webpath/${rcpath}${module}/$release_num/$osx_zip/download
229 MD5: `$MD5SUM $osx_zip`
230 SHA1: `$SHA1SUM $osx_zip`
232 http://$webpath/${rcpath}${module}/$release_num/$win_exe/download
234 MD5: `$MD5SUM $win_exe`
235 SHA1: `$SHA1SUM $win_exe`
237 http://$webpath/${rcpath}${module}/$release_num/$win_zip/download
239 MD5: `$MD5SUM $win_zip`
240 SHA1: `$SHA1SUM $win_zip`
242 http://$webpath/${rcpath}${module}/$release_num/$src_bz2/download
244 MD5: `$MD5SUM $src_bz2`
245 SHA1: `$SHA1SUM $src_bz2`
247 http://$webpath/${rcpath}${module}/$release_num/$src_gz/download
249 MD5: `$MD5SUM $src_gz`
250 SHA1: `$SHA1SUM $src_gz`
257 echo "Aborting. Should not release untracked version number."
261 echo "Release candidate detected. Disabling web update."
263 rcpath
="release_candidates/"
267 if [ ! -f $osx_zip ]; then
268 echo "$osx_zip files not found. Place those in base directory and try again."
272 if [ $build_files = "yes" ]; then
277 if [ ! -f $src_gz -o ! -f $src_bz2 ]; then
278 echo "$src_gz or $src_bz2 not found. Rebuild and try again"
282 if [ ! -f $win_zip -o ! -f $win_exe ]; then
283 echo "$win_zip or $win_exe not found. Rebuild and try again"
287 # Check for uncommitted/queued changes.
288 if [ "$ignore_changes" != "yes" ]; then
290 git
diff --exit-code > /dev
/null
2>&1
291 if [ $?
-ne 0 ]; then
292 echo "Uncommitted changes found. Did you forget to commit? Aborting."
293 echo "Use --ignore-local-changes to skip this check."
299 create_email
> $email_file
301 username
="${user},sox"
303 if [ $update_web = "yes" -o $release_files = "yes" ]; then
304 echo "Creating shell on sourceforge for $username"
305 ssh ${username}@
${hostname} create
308 if [ $update_web = "yes" ]; then
309 echo "Updating web pages..."
310 # Delete only PNG filenames which have random PID #'s in them.
311 ssh ${username}@${hostname} rm -rf ${web_path}/soxpng
312 scp
-pr *.pdf
*.html soxpng
${username}@${hostname}:${web_path}
313 scp
-p Docs.Features
${username}@${hostname}:${web_path/wiki.d}
316 if [ $release_files = "yes" ]; then
317 ssh ${username}@${hostname} mkdir -p ${release_path}/${rcpath}${module}/${release_num}
318 rsync
-avz --delete --progress $release_list ${username}@${hostname}:${release_path}/${rcpath}${module}/${release_num}
319 # FIXME: Stop pushing this and need to find a solution to help push it later.
320 #scp -p NEWS ${username}@${hostname}:${release_path}/${rcpath}${module}/${release_num}/README