README.osx wasn't easily readable in Finder. Revert back to
[sox.git] / release.sh
blobb370a6165087c5e0d6370a16ca2a57959c4f3507
1 #!/bin/sh
3 # Automatable release steps. All are optional but default to enabled.
5 # 1. Build source packages.
6 # 2. Build Windows packages.
7 # 3. Generate announce email from NEWS file.
8 # 4. Build HTML and PDF documentation and upload to web site.
9 # 5. Create new release directory and upload packages to directory.
11 # After a release:
12 # * Need to update sourceforge for recommended package to give to each
13 # OS and send email using Mutt or similar.
14 # * Update front page of web site to point to latest files and give
15 # latest news.
17 # TODO: Can't be used for pre-releases right now.
18 # TODO: Make sure releases are tagged in cvs/git and no files remain
19 # uncommitted to make sure release is reproducable.
21 build_files=yes
22 update_web=yes
23 release_files=yes
25 # configure must have been ran to get release #.
26 [ ! -x configure ] && autoreconf -i
27 [ ! -f Makefile ] && ./configure
29 release_num=`grep Version: sox.pc | cut -d ' ' -f 2`
31 osx_zip="sox-${release_num}-macosx.zip"
32 win_zip="sox-${release_num}-win32.zip"
33 win_exe="sox-${release_num}-win32.exe"
34 src_gz="sox-${release_num}.tar.gz"
35 src_bz2="sox-${release_num}.tar.bz2"
36 release_list="$src_gz $src_bz2 $win_exe $win_zip $osx_zip"
38 email_list="sox-users@lists.sourceforge.net,sox-devel@lists.sourceforge.net"
39 email_file="sox-${release_num}.email"
41 username="${USER},sox"
42 hostname="shell.sourceforge.net"
43 release_path="/home/frs/project/s/so/sox/sox"
44 release_force="no"
45 web_path="/home/project-web/sox/htdocs"
47 build()
49 echo "Creating source packages..."
50 ! make -s distcheck && echo "distcheck failed" && exit 1
51 ! make -s dist-bzip2 && echo "dist-bzip2 failed" && exit 1
53 echo "Creating Windows packages..."
54 make -s distclean
55 rm -f $win_zip
56 rm -f $win_exe
57 ./mingwbuild
59 if [ $update_web = "yes" ]; then
60 echo "Creating HTML documentation for web site..."
61 ! make -s html && echo "html failed" && exit 1
63 echo "Creating PDF documentation for web site..."
64 ! make -s pdf && echo "pdf failed" && exit 1
68 create_email()
70 cat<<EMAIL_HEADER
71 Subject: [ANNOUNCE] SoX ${release_num} Released
72 To: ${email_list}
74 EMAIL_HEADER
76 cat NEWS
79 case $release_num in
80 *cvs|*cgit)
81 echo "Aborting. Should not release untracked version number."
82 exit 1
84 *rc*)
85 echo "TODO: Upload path for RC's is different. Aborting."
86 exit 1;
88 esac
90 if [ ! -f $osx_zip ]; then
91 echo "$osx_zip files not found. Place those in base directory and try again."
92 exit 1
96 if [ $build_files = "yes" ]; then
97 build
100 if [ ! -f $src_gz -o ! -f $src_bz2 ]; then
101 echo "$src_gz or $src_bz2 not found. Rebuild and try again"
102 exit 1
105 if [ ! -f $win_zip -o ! -f $win_exe ]; then
106 echo "$win_zip or $win_exe not found. Rebuild and try again"
107 exit 1
110 create_email > $email_file
112 if [ $update_web = "yes" -o $release_files = "yes" ]; then
113 echo "Creating shell on sourceforge for $username"
114 ssh ${username}@${hostname} create
115 sleep 30
118 if [ $update_web = "yes" ]; then
119 echo "Updating web pages..."
120 # Delete only PNG filenames which have random PID #'s in them.
121 ssh ${username}@${hostname} rm -rf ${web_path}/soxpng
122 scp -pr *.pdf *.html soxpng ${username}@${hostname}:${web_path}
123 scp -p Docs.Features ${username}@${hostname}:${web_path/wiki.d}
126 if [ $release_files = "yes" ]; then
127 echo "Checking for an existing release..."
128 if ssh ${username}@${hostname} ls ${release_path}/${release_num}/$src_gz >/dev/null 2>&1; then
129 if [ "$release_force" != "yes" ]; then
130 echo "error: file already exists!"
131 exit 1
133 ssh ${username}@${hostname} mkdir -p ${release_path}/${release_num}
134 scp -p $release_list ${username}@${hostname}:${release_path}/${release_num}
135 scp -p NEWS ${username}@${hostname}:${release_path}/${release_num}/README.txt