From a3afb249f563262099032a0a91171860045b2710 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 15 Nov 2020 17:50:14 +0100 Subject: [PATCH] Add notarize script --- bin/notarize_vimr.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 bin/notarize_vimr.sh diff --git a/bin/notarize_vimr.sh b/bin/notarize_vimr.sh new file mode 100755 index 00000000..642bea62 --- /dev/null +++ b/bin/notarize_vimr.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -Eeuo pipefail + +readonly vimr_app_path=${vimr_app_path:?"Path to VimR.app"} + +main() { + pushd "${vimr_app_path}/.." >/dev/null + echo "### Notarizing" + ditto -c -k --keepParent VimR.app VimR.app.zip + + echo "### Uploading" + declare -x request_uuid + request_uuid=$(xcrun \ + altool --notarize-app --primary-bundle-id "com.qvacua.VimR" \ + --username "hataewon@gmail.com" --password "@keychain:dev-notar" \ + --file VimR.app.zip | grep RequestUUID | sed -E 's/.* = (.*)/\1/') + readonly request_uuid + + pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null + echo "### Waiting for notarization ${request_uuid} to finish" + ./bin/wait_for_notarization.py + echo "### Notarization finished" + popd >/dev/null + + xcrun stapler staple VimR.app + popd >/dev/null +} + +main \ No newline at end of file