Skip to content

Add macOS code signing and notarization#185

Merged
jeremy merged 6 commits intomainfrom
apple-notarize
Mar 4, 2026
Merged

Add macOS code signing and notarization#185
jeremy merged 6 commits intomainfrom
apple-notarize

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 3, 2026

Summary

  • Add GoReleaser v2 notarize.macos block to sign and notarize darwin binaries using the existing Ubuntu runner (no macOS runner needed). Uses the org's existing Developer ID Application certificate (Basecamp, LLC / 2WNYUYRS7G) with a dedicated App Store Connect API key for this repo.
  • Wire five MACOS_* secrets into the release workflow with a fail-closed preflight check on the canonical repo (forks skip gracefully).
  • Signing secrets live in a release environment so they're only accessible to the release job.
  • Fix install script cosign verification to use .bundle format, matching actual release assets.

Setup (one-time, before first signed release)

1. Create the release environment

Settings → Environments → New environment → name it release. Restrict to main branch under deployment branch rules.

2. Add environment secrets

Add the five MACOS_* secrets to the release environment. See RELEASING.md for details.

Test plan

  • goreleaser check passes (verified locally)
  • goreleaser release --snapshot --clean with env vars exported — darwin binaries built, notarize block correctly skipped when secrets empty
  • Push a tag to a fork with secrets configured for full pipeline including notarization
  • Download darwin archive, run codesign -dv --verbose=4 basecamp — should show Developer ID Application identity
  • Download via install script on macOS — should not trigger Gatekeeper
  • Verify cosign bundle verification works: cosign verify-blob --bundle checksums.txt.bundle ... — Verified OK against latest release

jeremy added 3 commits March 3, 2026 13:19
Use GoReleaser v2's native notarize.macos support (powered by embedded
quill) to sign and notarize darwin binaries on the existing Ubuntu runner.

The enabled gate requires all five MACOS_* secrets to be present,
cleanly skipping for forks and local builds. Explicit ids: [basecamp]
prevents accidental scope expansion if new build targets are added.
Pass MACOS_SIGN_P12, MACOS_SIGN_PASSWORD, MACOS_NOTARY_KEY,
MACOS_NOTARY_KEY_ID, and MACOS_NOTARY_ISSUER_ID to GoReleaser.

A preflight step on the canonical repo fails fast if any secret is
missing, preventing silent publication of unsigned macOS binaries.
Forks skip the check via github.repository guard.

Bump release job timeout from 15m to 45m for notarization wait headroom.
The release workflow produces checksums.txt.bundle (cosign v2 bundle),
not the separate .sig/.pem files the installer was trying to download.
Switch to --bundle flag to match actual release assets.
Copilot AI review requested due to automatic review settings March 3, 2026 21:20
@github-actions github-actions bot added ci CI/CD workflows enhancement New feature or request labels Mar 3, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds macOS code signing and notarization to the release pipeline using GoReleaser v2's built-in notarize.macos block (powered by Quill, which runs cross-platform on Ubuntu). It also fixes a pre-existing bug where the install script's cosign verification used the old separate .sig/.pem format instead of the .bundle format already produced by GoReleaser.

Changes:

  • Add GoReleaser notarize.macos block with conditional enablement via isEnvSet template, using five new MACOS_* environment variables for the signing certificate and App Store Connect API key.
  • Add a preflight step in the release workflow to verify macOS secrets are present before GoReleaser runs (fail-closed on the canonical repo, gracefully skipped on forks), pass the five secrets into GoReleaser, and extend the job timeout from 15→45 minutes to accommodate notarization wait time.
  • Fix scripts/install.sh cosign verification to use --bundle checksums.txt.bundle instead of the previous --certificate/--signature pair, matching the actual release asset format.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.goreleaser.yaml Adds notarize.macos block with conditional enablement and credential templates
.github/workflows/release.yml Adds preflight secrets check, wires MACOS_* secrets into GoReleaser, increases job timeout
scripts/install.sh Fixes cosign verify-blob to use --bundle format matching actual release assets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jeremy added 2 commits March 3, 2026 13:25
GitHub Actions sets missing secrets as empty strings, so isEnvSet
returns true even on forks without secrets configured. Switch to
Go template truthiness (empty string is falsy) so the notarize
block is skipped when secrets are absent.
@github-actions github-actions bot added the docs label Mar 3, 2026
Add `environment: release` to the release job so signing credentials
are only accessible to that specific job context. Isolates the
Developer ID cert and App Store Connect API key from other workflows.
Copilot AI review requested due to automatic review settings March 3, 2026 23:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy merged commit 5512797 into main Mar 4, 2026
25 checks passed
@jeremy jeremy deleted the apple-notarize branch March 4, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD workflows docs enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants