2020-03-03 05:19:36 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Inspired by https://github.com/metabrainz/picard/blob/master/scripts/package/macos-notarize-app.sh
|
|
|
|
|
2021-01-19 07:17:10 +00:00
|
|
|
set -eux
|
2020-03-03 05:19:36 +00:00
|
|
|
|
|
|
|
APP_BUNDLE_ID="com.borgbase.client.macos"
|
|
|
|
APP_BUNDLE="Vorta"
|
2021-01-19 07:17:10 +00:00
|
|
|
# CERTIFICATE_NAME="Developer ID Application: Joe Doe (XXXXXX)"
|
|
|
|
# APPLE_ID_USER="name@example.com"
|
2023-10-24 10:37:40 +00:00
|
|
|
# APPLE_ID_PASSWORD="CHANGEME"
|
|
|
|
# APPLE_TEAM_ID="CNMSCAXT48"
|
2020-03-03 05:19:36 +00:00
|
|
|
|
|
|
|
|
2021-01-19 07:17:10 +00:00
|
|
|
# Sign app bundle, Sparkle and Borg
|
2020-03-03 05:19:36 +00:00
|
|
|
codesign --verbose --force --sign "$CERTIFICATE_NAME" --timestamp --deep --options runtime \
|
2022-01-27 06:56:10 +00:00
|
|
|
$APP_BUNDLE.app/Contents/Frameworks/Sparkle.framework
|
2020-03-03 05:19:36 +00:00
|
|
|
|
2021-01-19 07:17:10 +00:00
|
|
|
find $APP_BUNDLE.app/Contents/Resources/borg-dir \
|
|
|
|
-type f \( -name \*.so -or -name \*.dylib -or -name borg.exe -or -name Python \) \
|
|
|
|
-exec codesign --verbose --force --timestamp --deep --sign "${CERTIFICATE_NAME}" \
|
|
|
|
--entitlements ../package/entitlements.plist --options runtime {} \;
|
|
|
|
|
2020-03-03 05:19:36 +00:00
|
|
|
codesign --verify --force --verbose --deep \
|
|
|
|
--options runtime --timestamp \
|
|
|
|
--entitlements ../package/entitlements.plist \
|
|
|
|
--sign "$CERTIFICATE_NAME" $APP_BUNDLE.app
|
|
|
|
|
2021-01-19 07:17:10 +00:00
|
|
|
|
|
|
|
# Create DMG
|
2020-03-03 05:19:36 +00:00
|
|
|
rm -rf $APP_BUNDLE.dmg
|
2021-01-19 07:17:10 +00:00
|
|
|
create-dmg \
|
|
|
|
--volname "Vorta Installer" \
|
|
|
|
--window-size 410 300 \
|
|
|
|
--icon-size 100 \
|
|
|
|
--icon "Vorta.app" 70 150 \
|
|
|
|
--hide-extension "Vorta.app" \
|
|
|
|
--app-drop-link 240 150 \
|
|
|
|
"Vorta.dmg" \
|
|
|
|
"Vorta.app"
|
|
|
|
|
|
|
|
# Notarize DMG
|
2023-10-24 10:37:40 +00:00
|
|
|
xcrun notarytool submit \
|
|
|
|
--output-format plist --wait --timeout 10m \
|
|
|
|
--apple-id $APPLE_ID_USER \
|
|
|
|
--password $APPLE_ID_PASSWORD \
|
|
|
|
--team-id $APPLE_TEAM_ID \
|
|
|
|
"$APP_BUNDLE.dmg"
|
2020-03-03 05:19:36 +00:00
|
|
|
|
|
|
|
# Staple the notary ticket
|
|
|
|
xcrun stapler staple $APP_BUNDLE.dmg
|
|
|
|
xcrun stapler staple $APP_BUNDLE.app
|
2021-01-19 07:17:10 +00:00
|
|
|
xcrun stapler validate $APP_BUNDLE.dmg
|