From 00651d670d5438bbd601c7cb049ee062e72b1dfb Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 19 Jun 2023 06:38:34 -0400 Subject: [PATCH] Switch to notarytool for Mac build notarization --- app/build.sh | 30 ++---------------------------- app/config.sh | 1 + app/scripts/notarization_info | 3 ++- app/scripts/notarization_status | 18 ------------------ app/scripts/notarize_mac_app | 2 +- 5 files changed, 6 insertions(+), 48 deletions(-) delete mode 100755 app/scripts/notarization_status diff --git a/app/build.sh b/app/build.sh index 6975602463..472f2f05ce 100755 --- a/app/build.sh +++ b/app/build.sh @@ -587,37 +587,11 @@ if [ $BUILD_MAC == 1 ]; then if [ "$UPDATE_CHANNEL" != "test" ]; then # Upload disk image to Apple - output=$("$CALLDIR/scripts/notarize_mac_app" "$dmg") + "$CALLDIR/scripts/notarize_mac_app" "$dmg" echo - echo "$output" - echo - id=$(echo "$output" | plutil -extract notarization-upload.RequestUUID xml1 -o - - | sed -n "s/.*\(.*\)<\/string>.*/\1/p") - echo "Notarization request identifier: $id" - echo - - sleep 60 - - # Check back every 30 seconds, for up to an hour - i="0" - while [ $i -lt 120 ] - do - status=$("$CALLDIR/scripts/notarization_status" $id) - if [[ $status != "in progress" ]]; then - break - fi - echo "Notarization in progress" - sleep 30 - i=$[$i+1] - done # Staple notarization info to disk image - if [ $status == "success" ]; then - "$CALLDIR/scripts/notarization_stapler" "$dmg" - else - echo "Notarization failed!" - "$CALLDIR/scripts/notarization_status" $id - exit 1 - fi + "$CALLDIR/scripts/notarization_stapler" "$dmg" echo "Notarization complete" else diff --git a/app/config.sh b/app/config.sh index fcd2bc9726..b4c007e9bc 100644 --- a/app/config.sh +++ b/app/config.sh @@ -22,6 +22,7 @@ KEYCHAIN="" KEYCHAIN_PASSWORD="" NOTARIZATION_BUNDLE_ID="" NOTARIZATION_USER="" +NOTARIZATION_TEAM_ID="" NOTARIZATION_PASSWORD="" # Paths for Windows installer build diff --git a/app/scripts/notarization_info b/app/scripts/notarization_info index 8865be4614..08b3b09794 100755 --- a/app/scripts/notarization_info +++ b/app/scripts/notarization_info @@ -15,4 +15,5 @@ if [[ -z "$id" ]]; then usage fi -xcrun altool --notarization-info "$id" -u "$NOTARIZATION_USER" -p "$NOTARIZATION_PASSWORD" --output-format xml +xcrun notarytool log "$id" --apple-id "$NOTARIZATION_USER" --team-id "$NOTARIZATION_TEAM_ID" --password "$NOTARIZATION_PASSWORD" notary_log.json +cat notary_log.json diff --git a/app/scripts/notarization_status b/app/scripts/notarization_status deleted file mode 100755 index dd6aba6431..0000000000 --- a/app/scripts/notarization_status +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -euo pipefail - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -ROOT_DIR="$(dirname "$SCRIPT_DIR")" -. "$ROOT_DIR/config.sh" - -function usage { - echo "Usage: $0 id" - exit 1 -} - -id=${1:-} -if [[ -z "$id" ]]; then - usage -fi - -$SCRIPT_DIR/notarization_info "$id" | plutil -extract notarization-info.Status xml1 -o - - | sed -n "s/.*\(.*\)<\/string>.*/\1/p" diff --git a/app/scripts/notarize_mac_app b/app/scripts/notarize_mac_app index fcfa8d1603..89375ecdf9 100755 --- a/app/scripts/notarize_mac_app +++ b/app/scripts/notarize_mac_app @@ -16,4 +16,4 @@ if [[ -z "$file" ]]; then fi echo "Uploading ${file##*/} to Apple for notarization" >&2 -xcrun altool --notarize-app --primary-bundle-id "$NOTARIZATION_BUNDLE_ID" --username "$NOTARIZATION_USER" --password "$NOTARIZATION_PASSWORD" --file $file --output-format xml +xcrun notarytool submit $file --apple-id "$NOTARIZATION_USER" --team-id "$NOTARIZATION_TEAM_ID" --password="$NOTARIZATION_PASSWORD" --wait