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