@@ -20,25 +20,55 @@ Clippy, and tests, builds Linux x86-64 and macOS arm64 archives, generates
2020checksums, and publishes them to the tagged GitHub release. Prerelease tags are
2121marked as prereleases on GitHub.
2222
23- ## Optional macOS signing and notarization
23+ ## macOS signing and notarization
2424
25- The macOS build does not require Apple credentials. When none are configured,
26- the workflow publishes an unsigned, unnotarized archive and identifies it as
27- such in the release notes . This is the expected setup until signing credentials
28- are added to the repository .
25+ The release workflow signs the standalone Mach-O executable with the code-signing
26+ identifier ` com.speakeasy.kit ` , enables the hardened runtime, and submits it to
27+ Apple's notary service . This Developer ID distribution does not require an Apple
28+ App ID or provisioning profile .
2929
30- To enable signing and notarization, configure all of these repository secrets :
30+ Create the credentials as follows :
3131
32- - ` MACOS_CERTIFICATE_P12_BASE64 `
33- - ` MACOS_CERTIFICATE_PASSWORD `
34- - ` MACOS_SIGNING_IDENTITY `
35- - ` APPLE_API_KEY_P8_BASE64 `
36- - ` APPLE_API_KEY_ID `
37- - ` APPLE_API_ISSUER_ID `
32+ 1 . In Keychain Access, use ** Certificate Assistant > Request a Certificate From
33+ a Certificate Authority** to save a certificate signing request (CSR).
34+ 2 . In Apple Developer ** Certificates, Identifiers & Profiles** , create a
35+ ** Developer ID Application** certificate from that CSR. If that option is not
36+ available for your role, ask the team's Account Holder to create it. Import
37+ the downloaded certificate on the Mac that created the CSR.
38+ 3 . In Keychain Access, export the Developer ID certificate together with its
39+ private key as a password-protected PKCS #12 (` .p12 ` ) file. Record the exact
40+ identity shown by ` security find-identity -v -p codesigning ` . It normally has
41+ the form ` Developer ID Application: <Organization> (<TEAM_ID>) ` .
42+ 4 . In App Store Connect ** Users and Access > Integrations** , create a team API
43+ key that can access the notary service. Record its key ID and issuer ID, and
44+ retain the downloaded ` .p8 ` ; Apple does not allow it to be downloaded again.
45+ 5 . Store the ` .p12 ` , its password, and the ` .p8 ` in the company's secret manager.
46+ Configure these repository Actions secrets:
47+
48+ - ` MACOS_CERTIFICATE_P12_BASE64 ` : base64-encoded ` .p12 `
49+ - ` MACOS_CERTIFICATE_PASSWORD ` : ` .p12 ` export password
50+ - ` MACOS_SIGNING_IDENTITY ` : exact Keychain identity from step 3
51+ - ` APPLE_API_KEY_P8_BASE64 ` : base64-encoded ` .p8 `
52+ - ` APPLE_API_KEY_ID ` : App Store Connect API key ID
53+ - ` APPLE_API_ISSUER_ID ` : App Store Connect issuer ID
54+
55+ For example, from a trusted Mac authenticated to GitHub CLI:
56+
57+ ``` sh
58+ repo=speakeasy-api/kit
59+ base64 < DeveloperIDApplication.p12 | gh secret set MACOS_CERTIFICATE_P12_BASE64 -R " $repo "
60+ read -r -s ' p12_password?P12 password: ' ; echo
61+ printf %s " $p12_password " | gh secret set MACOS_CERTIFICATE_PASSWORD -R " $repo "
62+ unset p12_password
63+ printf %s ' Developer ID Application: Example Corp (TEAMID)' | gh secret set MACOS_SIGNING_IDENTITY -R " $repo "
64+ base64 < AuthKey_KEYID.p8 | gh secret set APPLE_API_KEY_P8_BASE64 -R " $repo "
65+ printf %s ' KEYID' | gh secret set APPLE_API_KEY_ID -R " $repo "
66+ printf %s ' issuer-uuid' | gh secret set APPLE_API_ISSUER_ID -R " $repo "
67+ ```
3868
3969The workflow fails on a partial configuration rather than silently publishing
40- an unsigned build. Downloaded ` .p8 ` keys cannot be downloaded again, so retain
41- the original in the company's secret manager .
70+ an unsigned build. With none of these secrets configured, it still publishes an
71+ unsigned, unnotarized archive and identifies it as such in the release notes .
4272
4373## Verify a release
4474
0 commit comments