Skip to content

Commit

Permalink
Merge pull request #109 from learningequality/notary_public
Browse files Browse the repository at this point in the history
Update notarization to use notarytool.
  • Loading branch information
rtibbles committed Jun 28, 2023
2 parents 88eda41 + a0d3c1e commit 680dc3c
Showing 1 changed file with 4 additions and 32 deletions.
36 changes: 4 additions & 32 deletions notarize-dmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ primary_bundle_identifier=$( "${PLIST_BUDDY}" -c "Print CFBundleIdentifier" "dis

DISK_IMAGE_PATH="$1"

xcrun altool --notarize-app \
xcrun notarytool submit \
"${DISK_IMAGE_PATH}" \
--type osx \
--primary-bundle-id "org.learningequality.Kolibri" \
--username "${MAC_NOTARIZE_USERNAME}" \
--apple-id "${MAC_NOTARIZE_USERNAME}" \
--password "${MAC_NOTARIZE_PASSWORD}" \
--file "${DISK_IMAGE_PATH}" \
--wait \
--output-format xml | tee "build/notarize_result.plist"

notarize_exit=$?
Expand All @@ -25,35 +26,6 @@ fi
request_uuid="$("${PLIST_BUDDY}" -c "Print notarization-upload:RequestUUID" "build/notarize_result.plist")"
echo "Notarization UUID: ${request_uuid} result: $("${PLIST_BUDDY}" -c "Print success-message" "build/notarize_result.plist")"


# -------- Wait for notarization result

for (( ; ; ))
do
xcrun altool --notarization-info "${request_uuid}" \
-u "${MAC_NOTARIZE_USERNAME}" \
-p "${MAC_NOTARIZE_PASSWORD}" \
--output-format xml \
| tee "build/notarize_status.plist"

notarize_exit=$?
if [ "${notarize_exit}" != "0" ]
then
echo "Notarization failed: ${notarize_exit}"
cat "build/notarize_status.plist"
exit 1
fi
notarize_status="$("${PLIST_BUDDY}" -c "Print notarization-info:Status" "build/notarize_status.plist")"
if [ "${notarize_status}" == "in progress" ]
then
echo "Waiting for notarization to complete"
sleep 10
else
echo "Notarization status: ${notarize_status}"
break
fi
done

# -------- Staple DMG

echo "Stapling notarization result..."
Expand Down

0 comments on commit 680dc3c

Please sign in to comment.