comparison deploy/osx/deploy-and-package.sh @ 34:efb73feb1061

Enough MacOS bits to be able to do a quick proof-of-concept test
author Chris Cannam
date Fri, 13 Dec 2019 14:14:57 +0000
parents
children
comparison
equal deleted inserted replaced
33:dd41d7369ed5 34:efb73feb1061
1 #!/bin/bash
2
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
17
18 app="Vamp Plugin Pack Installer"
19
20 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
21
22 source="$app.app"
23 volume="$app"-"$version"
24 target="$volume"/"$app".app
25 dmg="$volume".dmg
26
27 if [ -d "$volume" ]; then
28 echo "Target directory $volume already exists, not overwriting"
29 exit 2
30 fi
31
32 if [ -f "$dmg" ]; then
33 echo "Target disc image $dmg already exists, not overwriting"
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"
40 fi
41
42 echo
43 echo "(Re-)running deploy script..."
44
45 deploy/osx/deploy.sh "$app" || exit 1
46
47 echo
48 echo "Making target tree."
49
50 mkdir "$volume" || exit 1
51
52 ln -s /Applications "$volume"/Applications
53 #cp README.md "$volume/README.txt"
54 #cp README.OSC "$volume/README-OSC.txt"
55 #cp COPYING "$volume/COPYING.txt"
56 #cp CHANGELOG "$volume/CHANGELOG.txt"
57 #cp CITATION "$volume/CITATION.txt"
58 cp -rp "$source" "$target"
59
60 # update file timestamps so as to make the build date apparent
61 find "$volume" -exec touch \{\} \;
62
63 echo "Done"
64
65 echo
66 echo "Code-signing volume..."
67
68 deploy/osx/sign.sh "$volume" || exit 1
69
70 echo "Done"
71
72 echo
73 echo "Making dmg..."
74
75 rm -f "$dmg"
76
77 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" -fs HFS+ &&
78 rm -r "$volume"
79
80 echo "Done"
81
82 echo
83 echo "Signing dmg..."
84
85 codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg"
86
87 if [ "$notarize" = no ]; then
88 echo
89 echo "The --no-notarization flag was set: not submitting for notarization"
90 else
91 echo
92 echo "Submitting dmg for notarization..."
93
94 deploy/osx/notarize.sh "$dmg" || exit 1
95 fi
96
97 echo "Done"