annotate deploy/clean-build-and-package @ 2451:22af3b429679

Exit on error
author Chris Cannam
date Wed, 15 Jan 2020 11:03:31 +0000
parents 7c09d776d579
children 32718f05903d
rev   line source
Chris@2390 1 #!/bin/bash
Chris@2390 2
Chris@2390 3 set -eu
Chris@2390 4
Chris@2390 5 current=$(hg id | awk '{ print $1; }')
Chris@2390 6
Chris@2396 7 case "$current" in
Chris@2396 8 *+) echo "ERROR: Current working copy has been modified - not proceeding";exit 2;;
Chris@2396 9 *);;
Chris@2396 10 esac
Chris@2390 11
Chris@2390 12 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
Chris@2390 13
Chris@2392 14 mkdir -p packages
Chris@2392 15 echo
Chris@2390 16
Chris@2392 17 if [ -d /Applications ]; then
Chris@2392 18
Chris@2392 19 qmake=$(grep '^# Command: ' Makefile | awk '{ print $3; }')
Chris@2392 20
Chris@2392 21 echo "Proceed to rebuild, package, and sign version $version using"
Chris@2392 22 echo -n "qmake path \"$qmake\" [Yn] ? "
Chris@2392 23 read yn
Chris@2392 24 case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac
Chris@2392 25 echo "Proceeding"
Chris@2392 26
Chris@2392 27 app="Sonic Visualiser"
Chris@2392 28 volume="$app"-"$version"
Chris@2392 29 dmg="$volume".dmg
Chris@2392 30
Chris@2392 31 rm -rf "$app.app"
Chris@2404 32 rm -rf "$volume"
Chris@2392 33 rm -f "$dmg"
Chris@2392 34
Chris@2392 35 ./repoint install
Chris@2392 36
Chris@2392 37 rm -rf .qmake.stash
Chris@2392 38 "$qmake" -r
Chris@2392 39 make clean
Chris@2392 40 make -j3
Chris@2392 41 deploy/osx/deploy-and-package.sh
Chris@2392 42
Chris@2392 43 mv "$dmg" packages/
Chris@2392 44
Chris@2392 45 else
Chris@2392 46
Chris@2392 47 echo -n "Proceed to rebuild and package version $version [Yn] ? "
Chris@2392 48 read yn
Chris@2392 49 case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac
Chris@2392 50 echo "Proceeding"
Chris@2392 51
Chris@2392 52 ./deploy/linux/build-and-test-appimage.sh
Chris@2392 53
Chris@2392 54 squashedversion=$(echo "$version" | sed 's/_-//g')
Chris@2392 55
Chris@2392 56 mv deploy/linux/docker/output/SonicVisualiser-"$current"-x86_64.AppImage \
Chris@2392 57 packages/SonicVisualiser-"$squashedversion"-x86_64.AppImage
Chris@2392 58
Chris@2392 59 ./deploy/linux/build-and-test-deb.sh
Chris@2392 60
Chris@2392 61 mv deploy/linux/docker/output/sonic-visualiser_"$version"_amd64.deb \
Chris@2392 62 packages/
Chris@2390 63 fi
Chris@2390 64
Chris@2390 65 echo "Done"
Chris@2390 66