Don't notarize 'test' channel builds on macOS

This commit is contained in:
Dan Stillman 2023-05-17 02:51:29 -04:00
parent 7482c2b4ec
commit 19265d4e98

View file

@ -576,40 +576,45 @@ if [ $BUILD_MAC == 1 ]; then
--sourcefile --volname Zotero --copy "$CALLDIR/mac/DSStore:/.DS_Store" \
--symlink /Applications:"/Drag Here to Install" > /dev/null
# Upload disk image to Apple
output=$("$CALLDIR/scripts/notarize_mac_app" "$dmg")
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
if [ "$UPDATE_CHANNEL" != "test" ]; then
# Upload disk image to Apple
output=$("$CALLDIR/scripts/notarize_mac_app" "$dmg")
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
if [ $status == "success" ]; then
"$CALLDIR/scripts/notarization_stapler" "$dmg"
else
echo "Notarization failed!"
"$CALLDIR/scripts/notarization_status" $id
exit 1
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"
echo "Notarization complete"
else
echo "Notarization failed!"
"$CALLDIR/scripts/notarization_status" $id
exit 1
echo "Test build -- skipping notarization"
fi
echo "Notarization complete"
echo
else
echo 'Not building on Mac; creating Mac distribution as a zip file'
rm -f "$DIST_DIR/Zotero_mac.zip"