Try to use notarytool
This commit is contained in:
parent
7310659a24
commit
a17ee176de
47
.github/scripts/sign-macos.sh
vendored
47
.github/scripts/sign-macos.sh
vendored
@ -58,34 +58,29 @@ hdiutil create -srcfolder "${app}" "${dmg}"
|
|||||||
# sign the .dmg
|
# sign the .dmg
|
||||||
codesign -s "${MACOS_DEVELOPER_ID}" --timestamp --options runtime -f --deep "${dmg}"
|
codesign -s "${MACOS_DEVELOPER_ID}" --timestamp --options runtime -f --deep "${dmg}"
|
||||||
|
|
||||||
# notarize and store request uuid in variable
|
if ! command -v xcrun >/dev/null || ! xcrun --find notarytool >/dev/null; then
|
||||||
notarize_uuid=$(xcrun altool --notarize-app --primary-bundle-id "${bundle_id}" --username "${MACOS_APPSTORE_USERNAME}" --password "${MACOS_APPSTORE_APP_PASSWORD}" --file "${dmg}" | grep RequestUUID | awk '{print $3'})
|
echo "Notarytool is not present in the system. Notarization has failed."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo $notarize_uuid
|
# Submit the package for notarization
|
||||||
|
notarization_output=$(
|
||||||
|
xcrun notarytool submit "${dmg}" \
|
||||||
|
--apple-id "@env:MACOS_APPSTORE_USERNAME" \
|
||||||
|
--password "@env:MACOS_APPSTORE_APP_PASSWORD" \
|
||||||
|
--team-id "8X77K9NDG3" \
|
||||||
|
--wait 2>&1)
|
||||||
|
|
||||||
# wait a bit so we don't get errors during checking
|
if [ $? -eq 0 ]; then
|
||||||
sleep 10
|
# Extract the operation ID from the output
|
||||||
|
operation_id=$(echo "$notarization_output" | awk '/RequestUUID/ {print $NF}')
|
||||||
success=0
|
echo "Notarization submitted. Operation ID: $operation_id"
|
||||||
for (( ; ; ))
|
exit 0
|
||||||
do
|
else
|
||||||
echo "Checking progress..."
|
echo "Notarization failed. Error: $notarization_output"
|
||||||
progress=$(xcrun altool --notarization-info "${notarize_uuid}" -u "${MACOS_APPSTORE_USERNAME}" -p "${MACOS_APPSTORE_APP_PASSWORD}" 2>&1)
|
exit 1
|
||||||
# echo "${progress}"
|
fi
|
||||||
|
fi
|
||||||
if [ $? -ne 0 ] || [[ "${progress}" =~ "Invalid" ]] ; then
|
|
||||||
echo "Error with notarization. Exiting"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${progress}" =~ "success" ]]; then
|
|
||||||
success=1
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "Not completed yet. Sleeping for 10 seconds"
|
|
||||||
fi
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
|
|
||||||
# staple
|
# staple
|
||||||
xcrun stapler staple "${dmg}"
|
xcrun stapler staple "${dmg}"
|
||||||
|
Loading…
Reference in New Issue
Block a user