annotate deploy/osx/deploy-and-package.sh @ 2374:9ca6872a5d0f

Rework deployment scripts with a separate package/notarize step
author Chris Cannam
date Wed, 16 Oct 2019 13:50:06 +0100
parents
children 995a4014a5c8
rev   line source
Chris@2374 1 #!/bin/bash
Chris@2374 2
Chris@2374 3 set -eu
Chris@2374 4
Chris@2374 5 app="Sonic Visualiser"
Chris@2374 6
Chris@2374 7 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
Chris@2374 8
Chris@2374 9 source="$app.app"
Chris@2374 10 volume="$app"-"$version"
Chris@2374 11 target="$volume"/"$app".app
Chris@2374 12 dmg="$app"-"$version".dmg
Chris@2374 13
Chris@2374 14 if [ -d "$volume" ]; then
Chris@2374 15 echo "Target directory $volume already exists, not overwriting"
Chris@2374 16 exit 2
Chris@2374 17 fi
Chris@2374 18
Chris@2374 19 if [ -f "$dmg" ]; then
Chris@2374 20 echo "Target disc image $dmg already exists, not overwriting"
Chris@2374 21 exit 2
Chris@2374 22 fi
Chris@2374 23
Chris@2374 24 echo
Chris@2374 25 echo "(Re-)running deploy script..."
Chris@2374 26
Chris@2374 27 deploy/osx/deploy.sh "$app" || exit 1
Chris@2374 28
Chris@2374 29 echo
Chris@2374 30 echo "Making target tree."
Chris@2374 31
Chris@2374 32 mkdir "$volume" || exit 1
Chris@2374 33
Chris@2374 34 ln -s /Applications "$volume"/Applications
Chris@2374 35 cp README.md "$volume/README.txt"
Chris@2374 36 cp README.OSC "$volume/README-OSC.txt"
Chris@2374 37 cp COPYING "$volume/COPYING.txt"
Chris@2374 38 cp CHANGELOG "$volume/CHANGELOG.txt"
Chris@2374 39 cp CITATION "$volume/CITATION.txt"
Chris@2374 40 cp -rp "$source" "$target"
Chris@2374 41
Chris@2374 42 # update file timestamps so as to make the build date apparent
Chris@2374 43 find "$volume" -exec touch \{\} \;
Chris@2374 44
Chris@2374 45 echo "Done"
Chris@2374 46
Chris@2374 47 echo
Chris@2374 48 echo "Code-signing volume..."
Chris@2374 49
Chris@2374 50 deploy/osx/sign.sh "$volume" || exit 1
Chris@2374 51
Chris@2374 52 echo "Done"
Chris@2374 53
Chris@2374 54 echo
Chris@2374 55 echo "Making dmg..."
Chris@2374 56
Chris@2374 57 rm -f "$dmg"
Chris@2374 58
Chris@2374 59 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" -fs HFS+ &&
Chris@2374 60 rm -r "$volume"
Chris@2374 61
Chris@2374 62 echo "Done"
Chris@2374 63
Chris@2374 64 echo
Chris@2374 65 echo "Signing dmg..."
Chris@2374 66
Chris@2374 67 codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg"
Chris@2374 68
Chris@2374 69 echo
Chris@2374 70 echo "Submitting dmg for notarization..."
Chris@2374 71
Chris@2374 72 deploy/osx/notarize.sh "$dmg" || exit 1
Chris@2374 73
Chris@2374 74 echo "Done"