This document covers every secret, certificate, and piece of configuration required to produce signed and notarized macOS .pkg installers through the release workflow.
| Requirement | Details |
|---|---|
| Apple Developer Program membership | Paid individual or organization account at developer.apple.com |
| Certificate: Developer ID Application | Required for code-signing the binaries with codesign |
| Certificate: Developer ID Installer | Required for signing the .pkg installers with productsign |
| Xcode Command Line Tools | Pre-installed on GitHub's macos-latest runner |
Important: You need two Developer ID certificates — one for binaries (
Application) and one for installers (Installer). Both should be exported into a single.p12file.
If you don't already have both certificates:
- Go to developer.apple.com/account/resources/certificates.
- Click + to create a new certificate.
- Under Software, select Developer ID Application and follow the CSR steps. Download and install it.
- Click + again, select Developer ID Installer, and repeat. Download and install it.
- Both certificates should now appear in Keychain Access under My Certificates.
Add all of the following in your GitHub repository under Settings > Secrets and variables > Actions > Repository secrets.
Base64-encoded .p12 certificate file containing both the Developer ID Application and Developer ID Installer certificates with their private keys.
How to export and encode:
-
Open Keychain Access on your Mac.
-
Select both certificates:
- Developer ID Application: Your Name (XXXXXXXXXX)
- Developer ID Installer: Your Name (XXXXXXXXXX)
-
Right-click > Export 2 items > choose
.p12format > save ascertificate.p12. -
Choose a strong export password (this becomes
MACOS_CERTIFICATE_PASSWORD). -
Encode it:
base64 -i certificate.p12 | pbcopy -
Paste the clipboard contents as the secret value.
The password you chose when exporting the .p12 from Keychain Access.
The exact Developer ID Application signing identity string for binary code-signing.
security find-identity -v -p codesigningExample: Developer ID Application: Acme Corp (AB12CD34EF)
The exact Developer ID Installer signing identity string for .pkg signing.
security find-identity -vExample: Developer ID Installer: Acme Corp (AB12CD34EF)
The Apple ID (email) associated with your Apple Developer Program account.
An app-specific password — not your Apple ID password. Generate at appleid.apple.com > Sign-In and Security > App-Specific Passwords.
Your 10-character Apple Developer Team ID from developer.apple.com/account > Membership Details.
| Secret name | Example value | Where to get it |
|---|---|---|
MACOS_CERTIFICATE |
MIIKxAIBAzCC... (base64) |
Keychain Access > Export both certs > base64 -i cert.p12 |
MACOS_CERTIFICATE_PASSWORD |
MyStr0ngP@ss! |
Password chosen during .p12 export |
MACOS_SIGNING_IDENTITY |
Developer ID Application: Acme Corp (AB12CD34EF) |
security find-identity -v -p codesigning |
MACOS_INSTALLER_SIGNING_IDENTITY |
Developer ID Installer: Acme Corp (AB12CD34EF) |
security find-identity -v |
MACOS_NOTARIZATION_APPLE_ID |
dev@example.com |
Apple ID email |
MACOS_NOTARIZATION_PASSWORD |
xxxx-xxxx-xxxx-xxxx |
appleid.apple.com > App-Specific Passwords |
MACOS_NOTARIZATION_TEAM_ID |
AB12CD34EF |
developer.apple.com > Membership Details |
gh secret set MACOS_CERTIFICATE --repo slashdevops/machineid --body "$(base64 -i certificate.p12)"
gh secret set MACOS_CERTIFICATE_PASSWORD --repo slashdevops/machineid
gh secret set MACOS_SIGNING_IDENTITY --repo slashdevops/machineid --body "Developer ID Application: Your Name (TEAMID)"
gh secret set MACOS_INSTALLER_SIGNING_IDENTITY --repo slashdevops/machineid --body "Developer ID Installer: Your Name (TEAMID)"
gh secret set MACOS_NOTARIZATION_APPLE_ID --repo slashdevops/machineid --body "yourname@example.com"
gh secret set MACOS_NOTARIZATION_PASSWORD --repo slashdevops/machineid
gh secret set MACOS_NOTARIZATION_TEAM_ID --repo slashdevops/machineid --body "AB12CD34EF"- Decodes
MACOS_CERTIFICATEinto a temporary.p12file. - Creates an ephemeral keychain on the runner (deleted after the job, via
if: always()). - Imports the certificates into that keychain and grants
codesignandproductsignaccess. - Builds darwin arm64 + amd64 binaries, merges them into a universal binary with
lipo. - Signs the binary with
codesign --options runtime --timestamp(hardened runtime required for notarization). - Creates a
.pkginstaller usingpkgbuild(installs to/usr/local/bin). - Signs the
.pkgwithproductsignusing the Developer ID Installer certificate. - Submits the
.pkgto Apple's notarization service viaxcrun notarytool submit --wait. - Staples the notarization ticket to the
.pkgwithxcrun stapler staple. - Uploads the
.pkgas a GitHub Release asset.