This is the runbook for cutting a release and for the one-time setup the
optional release steps need. Commands use placeholders in <angle brackets>; never commit real values.
-
Land the release on
main(the version bump PR updatesCHANGELOG.md: move## Unreleasedunder a## X.Y.Z (date)heading). -
Tag the merge commit and push the tag:
git switch main && git pull git tag vX.Y.Z git push origin vX.Y.Z -
The tag starts two workflows:
releaseruns GoReleaser (.goreleaser.yaml):- runs
go run ./tools/gendocsto generate shell completions and man pages; - cross-compiles
norcubefor darwin, linux (amd64, arm64) and windows (amd64); - signs and notarizes the darwin binaries (only with the Apple secrets; see below);
- builds the archives (
norcube_<os>_<arch>.tar.gz,.zipon Windows), the Linux packages (.deb,.rpm,.apk) and one SPDX SBOM per archive (syft); - writes
checksums.txtand signs it keylessly with cosign, using the workflow's GitHub OIDC identity, intochecksums.txt.sigstore.json; - creates the GitHub release with all of the above;
- updates the Homebrew cask, the Scoop manifest and opens the winget pull request (each only when its token is set);
- records SLSA build provenance for every file in
checksums.txtas a GitHub artifact attestation.
- runs
docs-referenceopens a pull request with the regenerated command reference on the docs repository.
-
Check the release page: the assets above are attached, and the workflow run's summary lists a notice for every optional step that was skipped.
A release without any of the optional secrets still succeeds; it is then
an unsigned, unnotarized release that only updates GitHub. checksums.txt,
its Sigstore signature, the SBOMs and the attestations need no secrets.
GoReleaser and syft versions match the workflow
(.github/workflows/release.yaml):
go run github.com/goreleaser/goreleaser/v2@v2.18.3 check
GOBIN="$PWD/bin" go install github.com/anchore/syft/cmd/syft@v1.54.1
PATH="$PWD/bin:$PATH" go run github.com/goreleaser/goreleaser/v2@v2.18.3 \
release --snapshot --clean --skip=publish,sign
ls dist/
rm -rf dist/ bin/The snapshot builds every archive, package and SBOM and renders the
Homebrew, Scoop and winget manifests into dist/ without uploading
anything. --skip=sign is needed locally because keyless signing needs
the workflow's OIDC token. Signing and notarization run locally too if you
export the MACOS_* variables.
Set them in the repository settings (Settings, Secrets and variables,
Actions) or with gh secret set <NAME> --repo norcubeplatform/cli. Every
one of them is optional.
| Secret | Enables | Without it |
|---|---|---|
MACOS_SIGN_P12 |
Signing the darwin binaries with the Developer ID Application certificate (base64 of the .p12) |
darwin binaries ship unsigned |
MACOS_SIGN_PASSWORD |
The password of that .p12; signing needs both |
as above |
MACOS_NOTARY_ISSUER_ID |
Notarization with Apple (App Store Connect API issuer id) | signed but not notarized |
MACOS_NOTARY_KEY_ID |
Notarization (API key id) | as above |
MACOS_NOTARY_KEY |
Notarization (base64 of the API key .p8) |
as above |
HOMEBREW_TAP_TOKEN |
Pushing the cask to norcubeplatform/homebrew-tap |
the cask is rendered but not pushed |
SCOOP_BUCKET_TOKEN |
Pushing the manifest to norcubeplatform/scoop-bucket |
the manifest is rendered but not pushed |
WINGET_TOKEN |
Pushing the manifests to the norcubeplatform/winget-pkgs fork and opening a pull request on microsoft/winget-pkgs |
no winget pull request |
DOCS_REPO_TOKEN (+ variable DOCS_REPO) |
The command reference pull request on the docs repository | skipped with a notice |
GITHUB_TOKEN is provided by Actions. The release job gets contents: write (the release), id-token: write (Sigstore and attestations) and
attestations: write; nothing else.
Do these in order; each step can be done on its own, and a release picks it up as soon as the secret exists.
Needs the Account Holder role of the Apple Developer Program team (only the Account Holder can create Developer ID certificates). The certificate is valid for five years.
-
Create a certificate signing request on a Mac:
- Open Keychain Access, then Keychain Access menu, Certificate Assistant, Request a Certificate From a Certificate Authority.
- User Email Address:
<your Apple ID email>; Common Name:Norcube Developer ID; CA Email Address: empty; Request is: Saved to disk. - Save
CertificateSigningRequest.certSigningRequest. Keychain Access keeps the matching private key in the login keychain.
-
Create the certificate:
- Go to https://developer.apple.com/account/resources/certificates/list and click the + button.
- Choose Developer ID Application, then the G2 Sub-CA profile.
- Upload the
.certSigningRequestand downloaddeveloperID_application.cer. - Double-click the
.cerso Keychain Access imports it next to the private key.
-
Export the certificate with its private key:
- In Keychain Access, open the login keychain, My Certificates.
- Select
Developer ID Application: <Team name> (<TEAM_ID>)(expand it to make sure the private key is under it). - File, Export Items, format Personal Information Exchange (.p12),
save as
developer-id.p12, and set a strong export password.
-
Check the file and store it as secrets:
# prompts for the export password and prints the certificate subject # (kept out of the command line, so it isn't saved in shell history) openssl pkcs12 -in developer-id.p12 -nokeys | openssl x509 -noout -subject base64 -i developer-id.p12 | tr -d '\n' \ | gh secret set MACOS_SIGN_P12 --repo norcubeplatform/cli gh secret set MACOS_SIGN_PASSWORD --repo norcubeplatform/cli # prompts for the value
-
Delete
developer-id.p12and the.cerfrom disk (the key stays in your keychain), or keep the.p12in the team's password manager.
-
Sign in to https://appstoreconnect.apple.com and open Users and Access, Integrations, App Store Connect API, Team Keys. The first time, the Account Holder has to request access to the API.
-
Click Generate API Key (or +), name it
norcube-cli-notary, choose the Developer role, and generate. -
Download the key (
AuthKey_<KEY_ID>.p8). Apple lets you download it only once. -
Note the Key ID (in the keys table) and the Issuer ID (above the table).
-
Store them:
gh secret set MACOS_NOTARY_ISSUER_ID --repo norcubeplatform/cli # paste the Issuer ID gh secret set MACOS_NOTARY_KEY_ID --repo norcubeplatform/cli # paste the Key ID base64 -i AuthKey_<KEY_ID>.p8 | tr -d '\n' \ | gh secret set MACOS_NOTARY_KEY --repo norcubeplatform/cli
-
Delete the
.p8from disk or keep it in the password manager. Revoke the key in the same page if it leaks; it has no expiry otherwise.
After the next release, check a darwin binary on a Mac:
tar -xzf norcube_darwin_arm64.tar.gz norcube
codesign -dv --verbose=2 ./norcube # Authority=Developer ID Application: ...
spctl --assess --type execute --verbose ./norcube # source=Notarized Developer IDNotarization of a bare binary can't be stapled, so Gatekeeper checks it
online on first launch. The release submits the binaries and doesn't wait
for Apple's answer (GoReleaser can wait at most 20 minutes, and a new
team's first submissions can take hours), so spctl reports Notarized Developer ID only once Apple has accepted the submission. Until then it
says the binary is unnotarized, and macOS warns on first launch of a
direct download. To see the status of recent submissions:
xcrun notarytool history --key AuthKey_<KEY_ID>.p8 --key-id <KEY_ID> --issuer <ISSUER_ID>The tap (norcubeplatform/homebrew-tap) already exists. Create the
bucket once:
gh repo create norcubeplatform/scoop-bucket --public --add-readme \
--description "Scoop bucket for the Norcube CLI"GoReleaser writes Casks/norcube.rb to the tap and bucket/norcube.json
to the bucket.
Create one fine-grained personal access token per repository, so each token can write to exactly one repository:
-
Open https://github.com/settings/personal-access-tokens/new (use an account with write access to the repository; a dedicated bot account is best).
-
Token name:
norcube-cli homebrew-tap(or... scoop-bucket). Resource owner:norcubeplatform. Expiration: the longest the organization allows; add a calendar reminder to rotate it. -
Repository access: Only select repositories, then
norcubeplatform/homebrew-tap(ornorcubeplatform/scoop-bucket). -
Permissions, Repository permissions: Contents: Read and write. Metadata: Read-only is added automatically. Nothing else.
-
Generate (an organization owner may have to approve the request under Organization settings, Personal access tokens, Pending requests).
-
Store it:
gh secret set HOMEBREW_TAP_TOKEN --repo norcubeplatform/cli # paste the tap token gh secret set SCOOP_BUCKET_TOKEN --repo norcubeplatform/cli # paste the bucket token
If the current HOMEBREW_TAP_TOKEN is a classic token, replace it with a
fine-grained one as above.
winget packages are published by pull request to
microsoft/winget-pkgs;
GoReleaser pushes the manifests (manifests/n/Norcube/CLI/<version>/) to
a branch of a fork and opens the pull request. Stays off until
WINGET_TOKEN is set, so set it last.
-
Fork the repository into the organization:
gh repo fork microsoft/winget-pkgs --org norcubeplatform \ --fork-name winget-pkgs --clone=false --default-branch-only
-
Create a classic personal access token with the
public_reposcope at https://github.com/settings/tokens/new, on an account that can push to the fork (a bot account is best). A fine-grained token is limited to one resource owner, so it can push to the fork but can't open the pull request onmicrosoft/winget-pkgs. -
Sign the Microsoft CLA with that account: the CLA bot asks on its first pull request.
-
Store it:
gh secret set WINGET_TOKEN --repo norcubeplatform/cli # paste the token
-
The first pull request for the
Norcube.CLIidentifier goes through Microsoft's validation and a moderator review, which can take days. Answer review comments on the pull request; later versions are usually merged automatically once validation passes.winget install Norcube.CLIworks after the first pull request is merged.
Sync the fork now and then (gh repo sync norcubeplatform/winget-pkgs)
so its branches start from a recent upstream.
- Delete a secret to switch its step off; the next release skips it with a notice.
- Developer ID certificates last five years: create a new one (step 1)
before the old one expires and replace both
MACOS_SIGN_*secrets. Releases signed with the old certificate stay valid. - Fine-grained tokens expire; regenerate them (step 3) and update the secret.
- Once every release is notarized, the cask's post-install hook that
clears the quarantine attribute (
homebrew_casks.hooksin.goreleaser.yaml) is no longer needed and can be removed.