Skip to content

Commit

Permalink
Export notarized dmg using make notarize validate dmg command
Browse files Browse the repository at this point in the history
  • Loading branch information
ailinykh committed May 11, 2024
1 parent f0e3d98 commit b5508a6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xcodebuild?=/usr/bin/xcodebuild
xcrun?=/usr/bin/xcrun

KEYCHAIN_PROFILE:=notarization-profile
PRODUCT_NAME:=ImgurBar
TMP:=$(shell mktemp -dt com.ailinykh.${PRODUCT_NAME})

Expand All @@ -12,6 +13,7 @@ RESULT_BUNDLE_PATH?=$(TMP)/$(PRODUCT_NAME).xcresult
EXPORT_PATH?=$(TMP)/$(PRODUCT_NAME).exported
APP_PATH?=$(EXPORT_PATH)/$(PRODUCT_NAME).app
ZIP_PATH?=$(TMP)/$(PRODUCT_NAME).zip
DMG_PATH?=$(TMP)/$(PRODUCT_NAME).dmg

.PHONY: archive
archive:
Expand All @@ -36,14 +38,18 @@ export: archive
-exportPath $(EXPORT_PATH) \
-exportOptionsPlist exportOptions.plist

# xcrun notarytool store-credentials --key <KEY.p8> --key-id <KEY_ID> --issuer <KEY_ISSUER> notarization-profile
# xcrun notarytool log <SUBMISSION_ID> --keychain-profile notarization-profile
# xcrun notarytool store-credentials --key <KEY.p8> --key-id <KEY_ID> --issuer <KEY_ISSUER> $(KEYCHAIN_PROFILE)
# xcrun notarytool log <SUBMISSION_ID> --keychain-profile $(KEYCHAIN_PROFILE)
.PHONY: notarize
notarize: export
/usr/bin/ditto -c -k --keepParent $(APP_PATH) $(ZIP_PATH); \
$(xcrun) notarytool submit $(ZIP_PATH) --verbose --wait --keychain-profile notarization-profile; \
$(xcrun) notarytool submit $(ZIP_PATH) --verbose --wait --keychain-profile $(KEYCHAIN_PROFILE); \
$(xcrun) stapler staple $(APP_PATH)

.PHONY: validate
validate:
spctl -av $(APP_PATH)
spctl -av $(APP_PATH)

.PHONY: dmg
dmg: export
hdiutil create -fs HFS+ -srcfolder $(APP_PATH) -volname $(PRODUCT_NAME) $(DMG_PATH)

0 comments on commit b5508a6

Please sign in to comment.