comparison deploy/osx/deploy-and-package.sh @ 2377:995a4014a5c8

Further Mac deployment updates
author Chris Cannam
date Wed, 16 Oct 2019 15:29:37 +0100
parents 9ca6872a5d0f
children 19cb6df86ef2
comparison
equal deleted inserted replaced
2376:06246370f210 2377:995a4014a5c8
1 #!/bin/bash 1 #!/bin/bash
2 2
3 set -eu 3 # Run this from the project root, without arguments, or with the
4 # single argument --no-notarization to skip the notarize step
5
6 set -e
7
8 notarize=yes
9 if [ "$1" = "--no-notarization" ]; then
10 notarize=no
11 elif [ -n "$1" ]; then
12 echo "Usage: $0 [--no-notarization]"
13 exit 2
14 fi
15
16 set -u
4 17
5 app="Sonic Visualiser" 18 app="Sonic Visualiser"
6 19
7 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` 20 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
8 21
9 source="$app.app" 22 source="$app.app"
10 volume="$app"-"$version" 23 volume="$app"-"$version"
11 target="$volume"/"$app".app 24 target="$volume"/"$app".app
12 dmg="$app"-"$version".dmg 25 dmg="$volume".dmg
13 26
14 if [ -d "$volume" ]; then 27 if [ -d "$volume" ]; then
15 echo "Target directory $volume already exists, not overwriting" 28 echo "Target directory $volume already exists, not overwriting"
16 exit 2 29 exit 2
17 fi 30 fi
18 31
19 if [ -f "$dmg" ]; then 32 if [ -f "$dmg" ]; then
20 echo "Target disc image $dmg already exists, not overwriting" 33 echo "Target disc image $dmg already exists, not overwriting"
21 exit 2 34 exit 2
35 fi
36
37 if [ "$notarize" = no ]; then
38 echo
39 echo "Note: The --no-notarization flag is set: won't be submitting for notarization"
22 fi 40 fi
23 41
24 echo 42 echo
25 echo "(Re-)running deploy script..." 43 echo "(Re-)running deploy script..."
26 44
64 echo 82 echo
65 echo "Signing dmg..." 83 echo "Signing dmg..."
66 84
67 codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg" 85 codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg"
68 86
69 echo 87 if [ "$notarize" = no ]; then
70 echo "Submitting dmg for notarization..." 88 echo
89 echo "The --no-notarization flag was set: not submitting for notarization"
90 else
91 echo
92 echo "Submitting dmg for notarization..."
71 93
72 deploy/osx/notarize.sh "$dmg" || exit 1 94 deploy/osx/notarize.sh "$dmg" || exit 1
95 fi
73 96
74 echo "Done" 97 echo "Done"