Repository navigation
ci(release): sign and notarize the macOS builds - #167
Merged
Merged
Conversation
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.
What
The release workflow can now sign the macOS downloads with a Developer ID Application certificate and have Apple notarize them.
hatchzipandhatchzip-gui(both architectures) are signed right after the build withcodesign --force --timestamp --options runtime, before the smoke tests and the packaging, so the tarballs and their.sha256hold the signed CLI.build-dmg.shtakes an optionalMACOS_SIGN_IDENTITY. With it, it signs the two programs insideHatchZip.app, then the bundle (inside out, no--deep), builds the dmg and signs the dmg. Without it, it runs the same ad hoc commands as before.notarytool submit --wait --timeout 30mand the ticket stapled. The CLI of each tarball is notarized as a zip of the binary (tar.gz isn't accepted); a bare binary can't be stapled, so Gatekeeper finds that ticket online. The app is not notarized and stapled on its own: the dmg is the outermost container and its ticket covers the app inside, which is Apple's standard flow for a dmg; a copied-out app gets its ticket checked online.notarytool log.stapler validateandspctl -a -t open --context context:primary-signatureon the dmg,codesign --verify --strict --deepandspctl --assess --type executeon the app inside it. If Gatekeeper is turned off on the runner, spctl reports an override; that is a warning, and stapler still checks the ticket.set-key-partition-list, set as the user search list and default), and anif: always()step deletes it. The identity is picked by SHA-1 among "Developer ID Application" identities ofAPPLE_TEAM_ID; anything other than exactly one fails. The.p12and.p8are written toRUNNER_TEMPwith mode 600 and removed. No new actions.How it's gated
MACOS_SIGNINGis true when every secret below andAPPLE_TEAM_IDare set and either the run is a tag with the variableSIGN_MACOSset totrue, or the run is not a tag andSIGN_DRY_RUNSistrue(the same rule as Windows). A tag withSIGN_MACOSon but a secret missing fails the job instead of publishing an unsigned app. Otherwise every new step is skipped and the job does what it did before.Setup for the maintainer
Also in packaging/README.md, "macOS: signing and notarization".
cert.p12, with a password.AuthKey_<id>.p8(only once), note the Key ID and the Issuer ID.SIGN_DRY_RUNSis alreadytrue. Rungh workflow run release --repo xevrion/hatchzip --ref main(or a branch), check the macos job (identity printed, each notarization Accepted, "check the signatures" passes), open a dmg from themacosartifact on a Mac. Thengh variable set SIGN_MACOS --repo xevrion/hatchzip --body true.Verified
Not verified
find-identityparsing, notarization, stapling and the spctl checks have not run anywhere yet.To update after the first notarized release
These still describe the ad hoc app and stay as they are until a notarized release ships:
xattr -dr com.apple.quarantineinstructions.