Shipping the Mac Component
6 minute read
Only maintainers cutting a Barn release need this page: it builds, signs, notarizes, and verifies the native macOS payload (the CLI, barn-hosts-helper, and Barn.app) inside barn_VERSION_darwin_arm64.tar.gz. To build Barn.app for your own use, see Build from Source; for the overall release order, see release gates.
Payload and signing order
packaging/mac-release.py build produces the payload: MACOS.md, MACOS.json, bin/barn, bin/barn-hosts-helper, and bin/Barn.app. MACOS.json records the version, source commit, file modes, digests, and signing state; the version and commit must match the GoReleaser archives the payload joins.
The app’s bundle identifier is com.pgsty.barn and its executable is barn-mac-runner. The CLI checks the runner’s versioned protocol and still recognizes the v0.9.0 bundle, Barn Mac.app (io.pgsty.barn.mac-runner). Replacing the app keeps VM state under $BARN_HOME/mac.
Because the CLI embeds the helper’s SHA-256, the payload builder signs in this order and the archive verifiers reject any other result:
- Build and sign
barn-hosts-helper. - Build
barnwith the signed helper’s SHA-256 embedded, then sign the CLI. - Sign
Barn.appwith hardened runtime and a secure timestamp. - Submit the CLI, helper, and app to Apple together for notarization. After acceptance, staple the app, validate its ticket, and check Gatekeeper.
- Export the payload, extract it again, and recheck the signatures and the stapled ticket.
- During release assembly, replace the CLI and helper in the Darwin arm64 archive with these exact signed bytes, and regenerate its SPDX document and the checksums.
Signing the helper again after the CLI is built changes its digest and breaks the pair.
Build a formal release locally
Use this path when the tag workflow has no signing secrets, or to produce release assets on a maintainer’s Mac.
Prepare the Mac. You need Apple Silicon with macOS 27+ and Xcode 27+, the toolchain pinned in
packaging/toolchain.env, andgoreleaser,syft,rpm,ruby,bsdtar,jq, andpython3onPATH. Find your Developer ID Application identity withsecurity find-identity -v -p codesigning, and store a notarization profile withxcrun notarytool store-credentials. Keep certificate private keys and passwords outside the repository.Check out the release tag.
release-localrequiresHEADat tagv<version>, a clean working tree and index with no untracked files, and anoriginremote.Synchronize the catalog if it changed. The formal payload build and
release-localboth runmake catalog-checkfirst and stop on any mismatch; see Maintain the image catalog.Build the signed payload and assemble the release into a new directory outside the source tree:
Variable Effect BARN_CODESIGN_IDENTITYDeveloper ID identity used to sign the helper, CLI, and app; unset means ad-hoc signing BARN_NOTARY_PROFILEStored notarytoolprofile; the payload is submitted to Apple for notarizationBARN_MAC_REQUIRE_NOTARIZATION=1Fails the build unless it is Developer ID signed and notarized; mac-release.py buildalso runs the catalog gate firstCheck the output.
release-localaccepts only a Developer ID signed, notarized payload built from the same commit, so a snapshot oruncommittedpayload fails here. It verifies archives, packages, SBOMs, checksums, and CLI/helper pairing, and writes the assets to$RELEASE_DIR/assets. Continue with acceptance.
Test packaging with a snapshot
In a checkout based on a stable release tag, use the same version helper as CI to select the next patch snapshot (for example, 1.4.1-next after v1.4.0). The packaging check compares the native payload’s version and commit. A dirty checkout uses uncommitted as the commit identifier.
Snapshots accept ad-hoc signatures; only formal release verification requires a notarized Developer ID payload.
Configure automated signing
The tag workflow uses these six repository secrets:
| Secret | Value |
|---|---|
MAC_CERTIFICATE_BASE64 | Base64-encoded Developer ID Application .p12, including the private key |
MAC_CERTIFICATE_PASSWORD | Password protecting the .p12 |
MAC_CODESIGN_IDENTITY | Imported identity name or certificate fingerprint |
MAC_NOTARY_KEY_BASE64 | Base64-encoded App Store Connect API .p8 key |
MAC_NOTARY_KEY_ID | API key identifier |
MAC_NOTARY_ISSUER | API issuer identifier |
| Secrets configured | Tag workflow behavior |
|---|---|
| None | Skips automatic release creation; use the local path |
| Some | Fails immediately |
| All six | Builds, signs, and notarizes the payload; any failure blocks release assembly |
The Mac workflow imports the signing material into an ephemeral runner keychain and removes it when the job ends; pull requests and snapshots use ad-hoc builds. The release workflow creates the draft release only after verifying the assembled payload.
Verify installation and publish
Run the gates:
make check,make mac-native-test, and a full snapshot with the native payload.Test installation in an isolated directory: first install, repeat install, and upgrade.
Run live acceptance on a supported physical Mac with the packaged app. Check startup, SSH, the desktop window, and normal shutdown; replacing the app must keep instance IDs, machine IDs, SSH keys, and host pins. The harness automates this:
Option Meaning --barnAbsolute path to the packaged barn--homeDedicated, disposable BARN_HOME;mac1is recreated and destroyed--outputNew or empty evidence directory, separate from --home--allow-test-rootRequired the first time; marks --homeas a destructive test root--planPrint the phases without running Barn or touching files --guiAdd desktop and clipboard checks --allow-downloadLet updownload macOS from Apple (about 26 GB) when no base is preparedA failed run keeps the VM state and the evidence. When testing SSH integration, isolate the process’s home directory as well as
BARN_HOME, because the managed~/.ssh/configentries live outside the VM state root.Sign and publish the draft. Stage the verified assets in the tag workflow or local draft. Sign the checksum manifest and upload
release.json,checksums.txtandchecksums.txt.sigtogether.make release-publish RELEASE_TAG=v<version>verifies the staged inventory and digests before publication. Signing stepsUpdate Homebrew. Release assembly generates
barn.rbfrompackaging/homebrew/barn.rb.tmpl, which installsbarnintobinand the helper and app intolibexec; keep its install and test logic aligned with the tap. Once the assets are public, update all four platform URLs and checksums. Versions with a suffix keep an explicitversionline, because Homebrew may otherwise infer64from the architecture suffix; plain versions omit it.Verify the public release. Install from the public archives, the installer, and a Homebrew upgrade against the released bytes, and record signing, notarization, VM acceptance, and public installation results separately in Validation History.