Chris@2374: #!/bin/bash Chris@2374: Chris@2377: # Run this from the project root, without arguments, or with the Chris@2377: # single argument --no-notarization to skip the notarize step Chris@2377: Chris@2377: set -e Chris@2377: Chris@2377: notarize=yes Chris@2377: if [ "$1" = "--no-notarization" ]; then Chris@2377: notarize=no Chris@2377: elif [ -n "$1" ]; then Chris@2377: echo "Usage: $0 [--no-notarization]" Chris@2377: exit 2 Chris@2377: fi Chris@2377: Chris@2377: set -u Chris@2374: Chris@2374: app="Sonic Visualiser" Chris@2374: Chris@2374: version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` Chris@2374: Chris@2374: source="$app.app" Chris@2374: volume="$app"-"$version" Chris@2374: target="$volume"/"$app".app Chris@2377: dmg="$volume".dmg Chris@2374: Chris@2374: if [ -d "$volume" ]; then Chris@2374: echo "Target directory $volume already exists, not overwriting" Chris@2374: exit 2 Chris@2374: fi Chris@2374: Chris@2374: if [ -f "$dmg" ]; then Chris@2374: echo "Target disc image $dmg already exists, not overwriting" Chris@2374: exit 2 Chris@2374: fi Chris@2374: Chris@2377: if [ "$notarize" = no ]; then Chris@2377: echo Chris@2377: echo "Note: The --no-notarization flag is set: won't be submitting for notarization" Chris@2377: fi Chris@2377: Chris@2374: echo Chris@2374: echo "(Re-)running deploy script..." Chris@2374: Chris@2374: deploy/osx/deploy.sh "$app" || exit 1 Chris@2374: Chris@2374: echo Chris@2374: echo "Making target tree." Chris@2374: Chris@2374: mkdir "$volume" || exit 1 Chris@2374: Chris@2374: ln -s /Applications "$volume"/Applications Chris@2374: cp README.md "$volume/README.txt" Chris@2544: cp README_OSC.md "$volume/README_OSC.txt" Chris@2374: cp COPYING "$volume/COPYING.txt" Chris@2374: cp CHANGELOG "$volume/CHANGELOG.txt" Chris@2374: cp CITATION "$volume/CITATION.txt" Chris@2374: cp -rp "$source" "$target" Chris@2374: Chris@2374: # update file timestamps so as to make the build date apparent Chris@2374: find "$volume" -exec touch \{\} \; Chris@2374: Chris@2374: echo "Done" Chris@2374: Chris@2374: echo Chris@2374: echo "Code-signing volume..." Chris@2374: Chris@2374: deploy/osx/sign.sh "$volume" || exit 1 Chris@2374: Chris@2374: echo "Done" Chris@2374: Chris@2374: echo Chris@2374: echo "Making dmg..." Chris@2374: Chris@2374: rm -f "$dmg" Chris@2374: Chris@2374: hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" -fs HFS+ && Chris@2374: rm -r "$volume" Chris@2374: Chris@2374: echo "Done" Chris@2374: Chris@2374: echo Chris@2374: echo "Signing dmg..." Chris@2374: Chris@2374: codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg" Chris@2374: Chris@2377: if [ "$notarize" = no ]; then Chris@2377: echo Chris@2377: echo "The --no-notarization flag was set: not submitting for notarization" Chris@2377: else Chris@2377: echo Chris@2377: echo "Submitting dmg for notarization..." Chris@2374: Chris@2377: deploy/osx/notarize.sh "$dmg" || exit 1 Chris@2377: fi Chris@2374: Chris@2374: echo "Done"