Repository navigation
fix(ci): ad-hoc sign macOS bundles so Gatekeeper stops reporting them as damaged - #4
Merged
Merged
Conversation
Without a Developer ID certificate the bundler was handed no signing identity at all, so it skipped signing entirely. A bundle with no signature is not merely untrusted on Apple Silicon: Gatekeeper reads it as corrupt, and a quarantined download reports "Donut is damaged and can't be opened" with only Move to Trash on offer. Fall back to codesign's ad-hoc identity when no certificate is configured. The bundler signs sidecars and nested binaries before the app bundle, and notarization stays skipped because APPLE_ID and friends remain unset. Also correct the documented quarantine path: the bundle is Donut.app, not the pre-rename Donut Browser.app.
Same fix for the tagged and nightly release paths: when no Developer ID certificate is configured, hand the bundler codesign's ad-hoc identity instead of leaving APPLE_SIGNING_IDENTITY unset, which made it skip signing entirely and produce a bundle Gatekeeper reads as corrupt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR fix?
No filed issue. Reported directly: the v0.30.1 Apple Silicon DMG fails to open with
"Donut" is damaged and can't be opened. You should move it to the Trash.The DMG is not corrupt.
Import Apple certificateexits early when the signing secrets are absent, leavingAPPLE_SIGNING_IDENTITYunset. Intauri-bundler, an absent identity makessign::keychain()returnNone, andmacos/app.rsthen skips the whole signing block — so the.appships with no_CodeSignatureat all. On Apple Silicon, Gatekeeper reads a quarantined bundle with no signature as corrupt rather than untrusted, and the resulting dialog offers only Move to Trash, with no Open Anyway.This falls back to codesign's ad-hoc identity (
-) when no certificate is configured.tauri_macos_sign::Keychain::with_signing_identity("-")setspath: None, so it runs a plaincodesign --force -s -with no keychain lookup, and the bundler signs inside-out (sidecars, then nested binaries, then the bundle). Notarization stays skipped: withAPPLE_ID/APPLE_PASSWORD/APPLE_TEAM_IDall unset,notarize_auth()returnsMissingCredentials, which is a warning rather than an error. The signed path with real secrets is unchanged.Applied to all three macOS-building workflows.
build-installers.ymlhad no certificate step at all, so it gets a smallif: matrix.family == 'macos'step.Also corrects the documented quarantine path.
productNameisDonut, so the bundle isDonut.app;Donut Browser.appis the pre-rename name thatapp_auto_updater.rscleans up, so the oldxattrcommand silently targeted a path that does not exist.How to test
Build Installersworkflow (workflow_dispatch, platformmacos) on this branch.donut-aarch64-apple-darwinartifact and open the DMG on Apple Silicon."Donut" is damaged and can't be opened, Move to Trash only. After: the ordinary unverified-developer prompt, approvable via System Settings → Privacy & Security → Open Anyway.codesign -dv --verbose=4 "/Volumes/Donut/Donut.app"should reportSignature=adhocinstead ofcode object is not signed at all.Known limitation: ad-hoc is not notarization. First launch still needs Open Anyway, and because an ad-hoc cdhash changes every build, TCC re-prompts for camera/microphone after each update. Setting the six
APPLE_*secrets restores full Developer ID signing and notarization through the existing code path.Checklist
pnpm format && pnpm lint && pnpm testlocally and it passesNotes on the above, for you to confirm and tick yourself:
pnpm formatandpnpm lintwere run and exit 0.pnpm testand the E2E suites were not run — no Rust or TypeScript changed, so no row of the E2E table in AGENTS.md applies.actionlintandtyposare clean on all three workflows. The release-timesedmarker rewrite was simulated locally to confirm the new README section sits outside<!-- install-links-* -->and survives. No user-facing strings changed, so no locale files are affected. Nothing here has been verified on real macOS hardware — step 2 above is the real test.AI usage (required)
Tick exactly one. Ticking neither, ticking both, or deleting this section closes the PR automatically.
Generated by Claude Code