@@ -9,6 +9,7 @@ This repo includes a GitHub Actions release workflow and a GoReleaser config.
993 . create a semver tag
10104 . push the tag
11115 . GitHub Actions builds release archives and checksums
12+ 6 . macOS release binaries are signed and notarized when the Apple secrets are configured
1213
1314## Example
1415
@@ -30,6 +31,51 @@ Configured in GoReleaser:
3031- darwin amd64 / arm64
3132- windows amd64 / arm64
3233
34+ ## macOS signing and notarization
35+
36+ This repo is configured to sign and notarize the ` darwin ` CLI binaries during the normal GitHub Releases flow.
37+
38+ The GoReleaser notarization block is enabled only when all required Apple secrets are present in GitHub Actions.
39+
40+ ### Apple prerequisites
41+
42+ You need:
43+
44+ - an Apple Developer account
45+ - a ` Developer ID Application ` certificate exported as ` .p12 `
46+ - the password for that ` .p12 `
47+ - an App Store Connect API key exported as ` .p8 `
48+ - the App Store Connect key ID
49+ - the App Store Connect issuer ID
50+
51+ ### GitHub Actions secrets
52+
53+ Add these repository or organization secrets before cutting a release:
54+
55+ - ` MACOS_SIGN_P12 ` — base64-encoded ` .p12 ` certificate contents
56+ - ` MACOS_SIGN_PASSWORD ` — password for the ` .p12 ` (may be empty if you exported the ` .p12 ` without one)
57+ - ` MACOS_NOTARY_KEY ` — base64-encoded ` .p8 ` App Store Connect key contents
58+ - ` MACOS_NOTARY_KEY_ID ` — App Store Connect key ID
59+ - ` MACOS_NOTARY_ISSUER_ID ` — App Store Connect issuer UUID
60+
61+ Example base64 commands:
62+
63+ ``` bash
64+ base64 < Certificates.p12 | tr -d ' \n'
65+ base64 < ApiKey_ABC123XYZ.p8 | tr -d ' \n'
66+ ```
67+
68+ ### Release result
69+
70+ When those secrets are present:
71+
72+ - Linux and Windows artifacts are built as before
73+ - macOS ` amd64 ` and ` arm64 ` binaries are signed before packaging
74+ - the macOS binaries are submitted to Apple for notarization
75+ - the notarized binaries are the ones included in the release archives
76+
77+ If the secrets are not present, the release still works, but macOS artifacts will be unsigned and unnotarized.
78+
3379## Manual re-release
3480
3581The workflow also supports ` workflow_dispatch ` with a tag input, for example:
@@ -46,8 +92,21 @@ If you want local GoReleaser snapshots, install GoReleaser and run:
4692goreleaser release --snapshot --clean
4793```
4894
95+ If the Apple environment variables are exported locally, the same config can sign and notarize macOS snapshot binaries as well.
96+
4997## Notes
5098
5199- release archives are named ` zencli_<version>_<os>_<arch> `
52100- Windows artifacts are zipped
53101- other platforms are archived as ` .tar.gz `
102+ - notarization is configured for standalone CLI binaries, not app bundles or ` .pkg ` installers
103+
104+ ## Verifying a downloaded macOS binary
105+
106+ After downloading and extracting a macOS release archive:
107+
108+ ``` bash
109+ codesign --verify --verbose ./zen
110+ spctl --assess --type execute --verbose ./zen
111+ xattr -p com.apple.quarantine ./zen 2> /dev/null || true
112+ ```
0 commit comments