2010-01-09 13:13:26 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-02-05 09:36:25 +04:00
|
|
|
# NB! To build a release build, the VERSION and VERSIONDATE environment variables needs to be set.
|
2013-01-18 00:02:28 +04:00
|
|
|
# See doc/release-checklist.txt
|
2010-01-09 13:13:26 +03:00
|
|
|
|
2013-05-16 04:33:24 +04:00
|
|
|
human_filesize()
|
|
|
|
{
|
|
|
|
awk -v sum=$1 'BEGIN {
|
|
|
|
hum[1024**3]="GB"; hum[1024**2]="MB"; hum[1024]="KB";
|
|
|
|
for (x=1024**3; x>=1024; x/=1024) {
|
|
|
|
if (sum>=x) { printf "%.1f %s\n",sum/x,hum[x]; break }
|
|
|
|
}
|
|
|
|
}'
|
|
|
|
}
|
|
|
|
|
|
|
|
# Pass version=<version> packagefile=<packagefile> filesize=<bytes>
|
|
|
|
update_www_download_links()
|
|
|
|
{
|
|
|
|
# Make the passed variables available
|
|
|
|
local $*
|
|
|
|
filesize=$(human_filesize $filesize)
|
|
|
|
webdir=../openscad.github.com
|
|
|
|
incfile=inc/mac_snapshot_links.js
|
2013-05-18 02:58:22 +04:00
|
|
|
BASEURL='https://openscad.googlecode.com/files/'
|
2013-05-16 04:33:24 +04:00
|
|
|
DATECODE=`date +"%Y.%m.%d"`
|
|
|
|
|
|
|
|
if [ -f $webdir/$incfile ]; then
|
|
|
|
cd $webdir
|
2013-05-29 09:38:06 +04:00
|
|
|
echo "fileinfo['MAC_SNAPSHOT_URL'] = '$BASEURL$packagefile'" > $incfile
|
|
|
|
echo "fileinfo['MAC_SNAPSHOT_NAME'] = 'OpenSCAD $version'" >> $incfile
|
|
|
|
echo "fileinfo['MAC_SNAPSHOT_SIZE'] = '$filesize'" >> $incfile
|
2013-05-16 04:33:24 +04:00
|
|
|
echo 'modified mac_snapshot_links.js'
|
|
|
|
|
|
|
|
git --no-pager diff
|
|
|
|
echo "Web page updated. Remember to commit and push openscad.github.com"
|
|
|
|
else
|
|
|
|
echo "Web page not found at $incfile"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2013-02-05 09:36:25 +04:00
|
|
|
if test -z "$VERSIONDATE"; then
|
|
|
|
VERSIONDATE=`date "+%Y.%m.%d"`
|
|
|
|
fi
|
2012-01-14 20:37:34 +04:00
|
|
|
if test -z "$VERSION"; then
|
2013-02-05 09:36:25 +04:00
|
|
|
VERSION=$VERSIONDATE
|
2012-01-14 20:37:34 +04:00
|
|
|
COMMIT=-c
|
2013-01-13 22:46:36 +04:00
|
|
|
SNAPSHOT=true
|
2012-01-14 20:37:34 +04:00
|
|
|
fi
|
|
|
|
|
2011-11-28 02:18:26 +04:00
|
|
|
# Turn off ccache, just for safety
|
|
|
|
PATH=${PATH//\/opt\/local\/libexec\/ccache:}
|
|
|
|
|
2010-05-28 03:18:08 +04:00
|
|
|
# This is the same location as DEPLOYDIR in macosx-build-dependencies.sh
|
2011-12-15 07:59:15 +04:00
|
|
|
export OPENSCAD_LIBRARIES=$PWD/../libraries/install
|
2010-01-22 16:22:16 +03:00
|
|
|
|
2013-01-17 20:37:51 +04:00
|
|
|
# Make sure that the correct Qt tools are used
|
|
|
|
export PATH=$OPENSCAD_LIBRARIES/bin:$PATH
|
|
|
|
|
2013-02-05 09:38:05 +04:00
|
|
|
`dirname $0`/release-common.sh -v $VERSION $COMMIT
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-05-28 03:18:08 +04:00
|
|
|
|
|
|
|
echo "Sanity check of the app bundle..."
|
2013-02-05 09:38:05 +04:00
|
|
|
`dirname $0`/macosx-sanity-check.py OpenSCAD.app/Contents/MacOS/OpenSCAD
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2013-02-05 09:36:25 +04:00
|
|
|
|
2013-02-12 06:44:48 +04:00
|
|
|
SIGNATURE=$(openssl dgst -sha1 -binary < OpenSCAD-$VERSION.dmg | openssl dgst -dss1 -sign dsa_priv.pem | openssl enc -base64)
|
|
|
|
|
2013-02-05 09:36:25 +04:00
|
|
|
if [[ $VERSION == $VERSIONDATE ]]; then
|
|
|
|
APPCASTFILE=appcast-snapshots.xml
|
|
|
|
else
|
|
|
|
APPCASTFILE=appcast.xml
|
|
|
|
fi
|
|
|
|
echo "Creating appcast $APPCASTFILE..."
|
2013-05-16 04:33:24 +04:00
|
|
|
FILESIZE=$(stat -f "%z" OpenSCAD-$VERSION.dmg)
|
|
|
|
sed -e "s,@VERSION@,$VERSION,g" -e "s,@VERSIONDATE@,$VERSIONDATE,g" -e "s,@DSASIGNATURE@,$SIGNATURE,g" -e "s,@FILESIZE@,$FILESIZE,g" $APPCASTFILE.in > $APPCASTFILE
|
2013-02-05 09:36:25 +04:00
|
|
|
cp $APPCASTFILE ../openscad.github.com
|
|
|
|
if [[ $VERSION == $VERSIONDATE ]]; then
|
|
|
|
cp $APPCASTFILE ../openscad.github.com/appcast-snapshots.xml
|
2010-05-10 21:42:27 +04:00
|
|
|
fi
|
2010-01-22 19:09:00 +03:00
|
|
|
|
2013-01-13 22:46:36 +04:00
|
|
|
echo "Uploading..."
|
2013-02-12 06:54:18 +04:00
|
|
|
LABELS=OpSys-OSX,Type-Executable
|
|
|
|
if ! $SNAPSHOT; then LABELS=$LABELS,Featured; fi
|
|
|
|
`dirname $0`/googlecode_upload.py -s 'Mac OS X Snapshot' -p openscad OpenSCAD-$VERSION.dmg -l $LABELS
|
2013-05-16 04:33:24 +04:00
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2011-09-11 22:56:45 +04:00
|
|
|
|
2013-06-13 21:45:39 +04:00
|
|
|
scp OpenSCAD-$VERSION.dmg openscad@files.openscad.org:www
|
|
|
|
if [[ $? != 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-02-05 09:38:05 +04:00
|
|
|
# Update snapshot filename on web page
|
2013-05-16 04:33:24 +04:00
|
|
|
update_www_download_links version=$VERSION packagefile=OpenSCAD-$VERSION.dmg filesize=$FILESIZE
|