Switch to notarytool for Mac build notarization

This commit is contained in:
Dan Stillman 2023-06-19 06:38:34 -04:00
parent f1003a1d1e
commit 00651d670d
5 changed files with 6 additions and 48 deletions

View file

@ -587,37 +587,11 @@ if [ $BUILD_MAC == 1 ]; then
if [ "$UPDATE_CHANNEL" != "test" ]; then if [ "$UPDATE_CHANNEL" != "test" ]; then
# Upload disk image to Apple # Upload disk image to Apple
output=$("$CALLDIR/scripts/notarize_mac_app" "$dmg") "$CALLDIR/scripts/notarize_mac_app" "$dmg"
echo echo
echo "$output"
echo
id=$(echo "$output" | plutil -extract notarization-upload.RequestUUID xml1 -o - - | sed -n "s/.*<string>\(.*\)<\/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 # Staple notarization info to disk image
if [ $status == "success" ]; then "$CALLDIR/scripts/notarization_stapler" "$dmg"
"$CALLDIR/scripts/notarization_stapler" "$dmg"
else
echo "Notarization failed!"
"$CALLDIR/scripts/notarization_status" $id
exit 1
fi
echo "Notarization complete" echo "Notarization complete"
else else

View file

@ -22,6 +22,7 @@ KEYCHAIN=""
KEYCHAIN_PASSWORD="" KEYCHAIN_PASSWORD=""
NOTARIZATION_BUNDLE_ID="" NOTARIZATION_BUNDLE_ID=""
NOTARIZATION_USER="" NOTARIZATION_USER=""
NOTARIZATION_TEAM_ID=""
NOTARIZATION_PASSWORD="" NOTARIZATION_PASSWORD=""
# Paths for Windows installer build # Paths for Windows installer build

View file

@ -15,4 +15,5 @@ if [[ -z "$id" ]]; then
usage usage
fi 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

View file

@ -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>\(.*\)<\/string>.*/\1/p"

View file

@ -16,4 +16,4 @@ if [[ -z "$file" ]]; then
fi fi
echo "Uploading ${file##*/} to Apple for notarization" >&2 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