-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Sign Mac OS Installer packages #9139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Relates #9139 This commit clarifies Mac OS Installer packages are unsigned due to additional work to obtain an Apple Developer ID Installer-signing identity.
This comment was marked as spam.
This comment was marked as spam.
|
As I was reading https://lokal.so/blog/guide-to-sign-and-notarize-your-go-app-for-outside-mac-app-store-distribution I noticed that they notarize the installer There's also some |
This comment has been minimized.
This comment has been minimized.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
As part of this work, the GitHub CLI website should be updated, directing users to download the Mac universal binary |
|
https://developer.apple.com/news/?id=saqachfa
|
This comment has been minimized.
This comment has been minimized.
This comment was marked as spam.
This comment was marked as spam.
Stapling is worthwhile, it attaches the notarization receipt to the package so that it's available even during offline validation. There's no need to notarize a package's contents separately, it can all be done in one pass (see here). You can authenticate to the notarization service either using an API key or an app-specific password. You can create an app-specific password through the Apple ID settings page for the account used to submit the notarization (docs). Here's an example using an app-specific password: productsign \
--sign "$DEVELOPER_ID_INSTALLER_CERTIFICATE" \
unsigned.pkg \
stapled.pkg
xcrun notarytool submit \
--wait \
--apple-id $APPLE_ID \
--team-id $TEAM_ID \
--password $APP_SPECIFIC_PASSWORD \
stapled.pkg
xcrun stapler staple stapled.pkg |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
1 similar comment
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Yes, you do have to notarize installer too, see the link to Notary API (there are Mac command-line tools too) here:
Probably the REST-based Notary API is the best choice: |
|
Also as mentioned at https://lokal.so/blog/guide-to-sign-and-notarize-your-go-app-for-outside-mac-app-store-distribution/ doing also Stapling apart from Notarization is optional, but has benefits if you manage to make it work:
|
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
IIUC, this should fix the notarization and stapling of the diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml
index 60354a95..60acfda3 100644
--- a/.github/workflows/deployment.yml
+++ b/.github/workflows/deployment.yml
@@ -134,6 +134,7 @@ jobs:
run: |
shopt -s failglob
script/pkgmacos "$TAG_NAME"
+ script/sign dist/gh_*_macOS_*.pkg
- uses: actions/upload-artifact@v4
with:
name: macos
diff --git a/script/sign b/script/sign
index f07a7d2d..d2186217 100755
--- a/script/sign
+++ b/script/sign
@@ -11,8 +11,16 @@ sign_macos() {
return 0
fi
- if [[ $1 == *.zip ]]; then
- xcrun notarytool submit "$1" --apple-id "${APPLE_ID?}" --team-id "${APPLE_DEVELOPER_ID?}" --password "${APPLE_ID_PASSWORD?}"
+ if [[ $1 == *.zip || $1 == *.pkg ]]; then
+ xcrun notarytool submit "$1" \
+ --apple-id "${APPLE_ID?}" \
+ --team-id "${APPLE_DEVELOPER_ID?}" \
+ --password "${APPLE_ID_PASSWORD?}" \
+ --wait
+
+ if [[ $1 == *.pkg ]]; then
+ xcrun stapler staple "$1"
+ fi
else
codesign --timestamp --options=runtime -s "${APPLE_DEVELOPER_ID?}" -v "$1"
fi |
Describe the feature or problem you’d like to solve
Mac OS Installer package support added in #7554 should sign
.pkgwith an appropriate Developer ID Installer-signing identity.sign_macoslogic withinscript/signscript/pkgmacosAdditional context
The existing GitHub CLI deployment workflow only has access to Developer ID Application certificate, which cannot be reused in for Installer packages.
The text was updated successfully, but these errors were encountered: