How to package and publish a release
This guide builds the release of razorbill, signs and notarizes rzb, and publishes it on Rickub, with the local-ci-*.sh scripts at the root of the repository. It assumes you can already build rzb on the Mac. Users install the result with INSTALL.MACOS.md.
| Step | Script | Where |
|---|---|---|
| Checks | ./local-ci-01-check.sh |
the Mac (on Linux, MLX is not tested) |
| Build, sign, notarize | ./local-ci-02-build.sh |
the Mac |
| Tag and draft prerelease | ./local-ci-03-create-draft.sh |
the Mac or Linux |
| Upload | ./local-ci-04-upload.sh |
the Mac or Linux |
| Publish | ./local-ci-05-publish.sh |
the Mac or Linux; asks you to type the tag |
| Promote (optional) | ./local-ci-06-promote.sh |
the Mac or Linux; asks you to type the tag |
Settings (once)
-
The Rickub token:
.ci.cd.token.envat the root, holdingCI_TOKEN=…. It is git-ignored; never commit it. -
The release settings:
.release.envat the root, also git-ignored:TAG="v1.0.0" ABOUT="razorbill — MLX model server with an OpenAI-compatible API" OWNER="bots-garden" REPO="razorbill" # macOS signature. Empty = rzb is not signed. RZB_SIGN_IDENTITY="${SIDEKICKS_SIGN_IDENTITY:-}" RZB_NOTARY_PROFILE="${SIDEKICKS_NOTARY_PROFILE:-}".release.envis read by bash: it picks up the variables exported in your~/.zshrc. -
The signing identity:
security find-identity -v -p codesigningmust list"Developer ID Application: … (TEAMID)", exactly the value ofRZB_SIGN_IDENTITY. The certificate belongs to the team, not to an application: the one that signs mini-me and Sidekicks signs rzb too. Nothing has to be registered at Apple for rzb; its identifier,com.bots-garden.rzb, is chosen by the script. -
The notarization profile:
xcrun notarytool history --keychain-profile "$RZB_NOTARY_PROFILE"must list submissions without an authentication error. If the profile is missing: create an app-specific password on account.apple.com, thenxcrun notarytool store-credentials <name> --apple-id <you@example.com> --team-id <TEAMID>. -
The hardened runtime: notarization requires it. Check that rzb still works under it, with the models of the compatibility suite pulled:
scripts/check-hardened-runtime.shIt signs a Release build like the release does (with
RZB_SIGN_IDENTITYwhen set, otherwise ad hoc) and runsscripts/compat.shagainst that copy: real chat, streaming, structured output, tools and embeddings. Run it again after an MLX or macOS upgrade. If it fails whilescripts/compat.shalone passes, rzb needs an entitlement: do not publish a signed release before that is solved.
Every release
-
Prepare the release (version in
Sources/RazorbillCore/Razorbill.swiftand the docs, release notesrelease-notes/vX.Y.Z.mdand.fr.md,TAGin.release.env): thereleaseskill does it. Commit and pushmain: step 03 refuses a tree that is not clean or aHEADthat is not the remote'smain. -
If the repository sits in a synced folder (kDrive, iCloud Drive…), pause the sync during step 02.
-
On the Mac:
./local-ci-01-check.sh ./local-ci-02-build.shWith
RZB_SIGN_IDENTITYset, step 02 checks the setup before building (identity in the keychain, working notarytool profile), builds in Release into.build/release, copiesrzband its bundles to a temporary folder, signs the bundles thenrzb(--options runtime --timestamp --identifier com.bots-garden.rzb), checks the signature (Developer ID authority,runtimeflag, timestamp), sends the folder to Apple in a.zipand waits forAccepted. Thenscripts/release.sh --productsmakes the archive, step 02 unpacks it, checks the signatures again and runs the unpackedrzb --version. You should see:🔏 Signing and notarizing rzb and its bundles... ✅ rzb signed (Developer ID, hardened runtime, timestamp) and 6 bundles sealed ⏳ waiting for Apple's notary service (a few minutes)... ✅ notarized (submission 1a2b3c4d-…) ✅ signatures intact in the unpacked archive ✅ the archived rzb starts and reports 1.0.0release/<TAG>/then holds the archive,SHA256SUMS, aREADME.mdandmacos-signature.txt(the signature and the notarization submission; not published). -
Then:
./local-ci-03-create-draft.sh # the tag v1.0.0 and a draft prerelease ./local-ci-04-upload.sh # the archive and SHA256SUMS ./local-ci-05-publish.sh # public; becomes /releases/latest ./local-ci-06-promote.sh # optional: removes the pre-release labelStep 03 writes the release text from
ABOUT, the summary sentence ofrelease-notes/<TAG>.md, the commit, the Xcode version (recorded by step 02), a signature line whenmacos-signature.txtexists, links to the notes and the install guide, and the checksum.LOCAL_CI_PRINT_NOTES=1 ./local-ci-03-create-draft.shprints that text and creates nothing.Rickub only accepts uploads from a CI job's token, so step 04 pushes a temporary branch holding the archive and a one-job workflow, waits for the job and deletes the branch. Step 05 downloads what is public and compares it with
release/<TAG>/. -
Try it as a user would: download the archive with a browser, unpack it, and run
rzb --versionfrom the folder; no dialog must block it.
A published release cannot take a new archive in place of the old one: Rickub refuses a file name that already exists. Publish a new version instead.
What the archive holds
| Entry | Role |
|---|---|
rzb |
The executable (Apple Silicon, macOS 14 or later), signed with the hardened runtime. |
mlx-swift_Cmlx.bundle |
The MLX Metal library (default.metallib); without it no model loads. |
swift-transformers_Hub.bundle, swift-nio_*.bundle, swift-crypto_Crypto.bundle |
The other resource bundles of the dependencies. Every *.bundle of the build is copied, and sealed by the signature. |
INSTALL.txt |
Where to put the folder; says whether the archive is signed. |
LICENSE |
The MIT license. |
The bundles must stay next to rzb: the folder is installed whole, with a launcher in bin/ (INSTALL.MACOS.md).
Variants
- Unsigned archive: leave
RZB_SIGN_IDENTITYempty. Step 02 warnsrzb is not signedandINSTALL.txtgives thexattrcommand. - Archive without the CI:
scripts/release.shbuilds and packages intodist/(unsigned).--products <dir>packages an existing build (also from Linux, without the finalrzb --versioncheck),--out <dir>writes elsewhere,--allow-dirtyaccepts uncommitted work (never publish such an archive).
Troubleshooting
| Symptom | What to do |
|---|---|
TAG is v… but Sources/RazorbillCore/Razorbill.swift says … |
The tag and the compiled version differ: fix one of them (the release skill sets both). |
RZB_SIGN_IDENTITY is set but RZB_NOTARY_PROFILE is not |
Add the profile to .release.env. A signed binary that is not notarized is still blocked by Gatekeeper. |
no valid identity "…" in the keychain |
security find-identity -v -p codesigning, copy the exact value. If it shows CSSMERR_TP_NOT_TRUSTED, install the Developer ID G2 intermediate certificate from apple.com/certificateauthority. |
the notarytool profile "…" does not work |
xcrun notarytool history --keychain-profile "…" gives the error; a revoked app-specific password is made again. |
notarization …: Invalid |
xcrun notarytool log <id> --keychain-profile "$RZB_NOTARY_PROFILE" (the command is printed) gives the reason. |
codesign refuses ("resource fork, Finder information, or similar detritus") |
Metadata from a synced folder. The script clears it with xattr -cr; pause the sync and run step 02 again. |
is not writable (left by a run with sudo?) |
sudo chown -R "$(whoami)" release dist .build, and never run these scripts with sudo. |
HEAD (…) is not the remote's main |
Push main first. |
See also
- Build rzb on the Mac
- Run the tests, which step 01 runs.
- Apple: Notarizing macOS software before distribution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|