@@ -26,6 +26,8 @@ PKGID ?= Developer ID Installer: Perry Kundert ($(TEAMID))
2626BUNDLEID ?= ca.kundert.perry.SLIP39
2727APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
2828APIKEY ?= 5H98J7LKPC
29+ APICREDENTIALS ?= ~/.private_keys/AuthKey_$(APIKEY ) .p8
30+
2931# PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_App_Store_Provisioning.provisionprofile
3032PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_General_Provisioning.provisionprofile
3133
@@ -428,27 +430,34 @@ dist/SLIP-39-$(VERSION).pkg-verify: dist/SLIP-39-$(VERSION).pkg
428430#
429431# macOS Package Notarization
430432# See: https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38
433+ # https://developer.apple.com/documentation/technotes/tn3147-migrating-to-the-latest-notarization-tool
431434# o The .pkg version doesn't work due to incorrect signing keys for the .pkg (unknown reason)
435+ #
436+ # Submits the version's .pkg for notariation, and waits for completion (success or failure).
437+ # - The output contains the Submission ID, required to obtain the JSON notary log
432438dist/SLIP-39-$(VERSION ) .pkg.notarization : dist/SLIP-39-$(VERSION ) .pkg dist/SLIP-39-$(VERSION ) .pkg-verify
433- jq -r ' .["notarization-upload"]["RequestUUID"]' $@ 2> /dev/null \
434- || xcrun altool --notarize-app -f $< \
435- --primary-bundle-id $(BUNDLEID ) \
436- --team-id $(TEAMID ) \
437- --apiKey $(APIKEY ) --apiIssuer $(APIISSUER ) \
438- --output-format json \
439+ grep " Submission ID" $@ 2> /dev/null \
440+ || xcrun notarytool submit \
441+ --issuer $(APIISSUER ) \
442+ --key-id $(APIKEY ) \
443+ --key $(APICREDENTIALS ) \
444+ --wait \
445+ $< \
439446 > $@
440447
441448dist/SLIP-39-$(VERSION ) .pkg.notarization-status : dist/SLIP-39-$(VERSION ) .pkg.notarization FORCE
442449 [ -s $@ ] && grep " Status: success" $@ \
443- || xcrun altool \
444- --apiKey $(APIKEY ) --apiIssuer $(APIISSUER ) \
445- --notarization-info $$( jq -r '.["notarization-upload"]["RequestUUID"]' $< ) \
446- | tee -a $@
450+ || xcrun notarytool log \
451+ --issuer $(APIISSUER ) \
452+ --key-id $(APIKEY ) \
453+ --key $(APICREDENTIALS ) \
454+ $$( grep -A1 "Submission ID" < $< | grep "id:" | awk '{print $$2}' ) \
455+ > $@
447456
448457# Check notarization status 'til Status: success, then staple it to ...pkg, and create ...pkg.valid marker file
449458dist/SLIP-39-$(VERSION ) .pkg.valid : dist/SLIP-39-$(VERSION ) .pkg.notarization-status FORCE
450- @grep " Status: success " $< || \
451- ( tail -10 $< ; echo -e " \n\n!!! App not yet notarized; try again in a few seconds ..." ; false )
459+ @grep " Ready for distribution " $< || \
460+ ( tail -10 $< ; echo -e " \n\n!!! App not yet notarized..." ; false )
452461 ( [ -r $@ ] ) \
453462 && ( echo -e " \n\n*** Notarization complete; refreshing $@ " && touch $@ ) \
454463 || ( \
0 commit comments