Skip to content

Commit 4370c99

Browse files
committed
[Makefile] add new macos code signing, installer notarization, and validation targets
1 parent 7f2145c commit 4370c99

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

Makefile

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,45 @@ build-macos: macos-iconset build-image-resource build-font-resource
3737
pyinstaller --noconfirm "target/PyInstaller-macOS/Slice-macOS.spec"
3838
cp LICENSE dist/license.txt
3939

40+
build-macos-installer:
41+
# https://github.com/sindresorhus/create-dmg
42+
- rm dist/*.dmg
43+
cd dist && create-dmg --identity="BOGUS" Slice.app
44+
45+
# -------------------------------------------
46+
# macOS platform distribution code signatures
47+
# -------------------------------------------
48+
49+
# code sign the application distribution bundle
4050
codesign-macos:
41-
codesign --deep -s "Christopher Simpkins" dist/Slice.app
51+
codesign --deep --timestamp --force --options runtime -s "Developer ID Application: Christopher Simpkins" dist/Slice.app
4252

43-
codesign-macos-installer:
44-
codesign -s "Christopher Simpkins" dist/*.dmg
53+
# verify code signature on the distribution bundle
54+
verify-codesign-macos:
55+
spctl -a -v dist/Slice.app
4556

46-
build-macos-installer:
47-
# https://github.com/sindresorhus/create-dmg
48-
cd dist && create-dmg --overwrite Slice.app
57+
# code sign the macOS installer
58+
codesign-macos-installer:
59+
codesign --timestamp --force --options runtime -s "Developer ID Application: Christopher Simpkins" dist/*.dmg
60+
61+
upload-macos-installer-for-notarize:
62+
# Requires Apple Developer account user name to be exported as the environment variable
63+
# APPLDEV_USERNAME before this target is executed
64+
# This will prompt for an app-specific password to be entered in stdin
65+
xcrun altool --notarize-app --type osx --primary-bundle-id "org.sourcefoundry.slice" --username @env:APPLEDEV_USERNAME --file dist/*.dmg
66+
67+
notarize-macos-installer:
68+
# Must export the notarization ID returned by upload-macos-installer-for-notarize
69+
# make target before this target is executed
70+
xcrun altool --notarization-info @env:SLICE_NOTARIZE_ID --username @env:APPLEDEV_USERNAME
71+
72+
staple-notary-macos:
73+
# requires successful notarize-macos-installer step completion
74+
xcrun stapler staple -v dist/*.dmg
75+
76+
# verify code signature on the macOS installer
77+
verify-notarize-macos-installer:
78+
spctl -a -t open --context context:primary-signature -v dist/*.dmg
4979

5080

5181
# -----------------------

0 commit comments

Comments
 (0)