Release runbook
How to publish a new version of gh-app-auth.
The normal path is merge the release-please PR. That starts the Release
workflow, which stages the tag and creates a draft release, builds and attaches
every asset, gates on the cross-platform E2E suite and provenance, then publishes
the draft as latest. Nothing is publicly visible until the final publish step —
the draft is the staging area, not a prerelease.
# Normal releases: review and merge the release-please PR.
# Manual override / pipeline validation: run explicitly against main and# provide either a version or an operator-selected bump.gh workflow run release.yml --ref main -f bump=minorgh workflow run release.yml --ref main -f version=v1.2.3gh workflow run release.yml --ref main -f version=v1.2.3 -f dry_run=true
# Watch and verifygh run watchgh release view v1.2.3Equivalent UI path: Actions → Release → Run workflow, selecting main.
The workflow rejects dispatches whose selected ref is not main; there is no
tag-push release trigger. Protect main with required review so the workflow
and release source can only change through reviewed commits. Tags are staged
and published only by the pipeline. The YAML guard prevents accidental
wrong-ref runs; it is not a substitute for protecting workflow files. Require
review for changes under .github/workflows/ on main and limit manual release
execution to trusted maintainers.
Automated trigger (release-please)
Section titled “Automated trigger (release-please)”release-please.yml runs on every push to main and maintains a release PR
that accumulates conventional-commit changelog entries and the proposed version
bump. The maintainer’s release action becomes “merge the release PR”:
merge release PR → release-please cuts tag + draft → workflow_call → release.yml- release-please creates the release as a draft (
"draft": trueinrelease-please-config.json— mandatory: a published release would lock its assets under immutable releases before the pipeline could attach them). - The handoff is an explicit
workflow_call, not a tag event; the release workflow is only called from a run onmain. - Release-please is authoritative for automatic version selection from
conventional commits.
.release-please-manifest.jsontracks its current version and the release PR updates the generated changelog. - Manual dispatch is an explicit operator override: supply
versionorbump=patch|minor|major. It does not independently interpret conventional commits; after an emergency manual release, reconcile the manifest and changelog through the release-please PR before the next normal release (rungh workflow run release-please.yml --ref mainto refresh it if needed). - While the project is
0.x,bump-minor-pre-majorkeeps breaking changes on a minor bump rather than jumping to1.0.0. - Post-merge regeneration quirk (observed on fork): immediately after a
release PR merges, release-please updates its standing PR before the
pipeline publishes — so the just-cut tag does not exist yet and the
regenerated PR mis-anchors on the previous tag, showing a noisy changelog and
a speculative next version. It self-corrects on the next push to
mainonce the tag has materialized. Do not merge a freshly regenerated release PR; leave it open and let it recompute. - Tag names are one-shot under immutable releases: deleting a published
release does not free its
tag_name— the name is permanently bound and any later release reusing it fails at publish (tag_name was used by an immutable release). Never re-cut a released version; bump instead. - Configure a
v*tag ruleset as defense in depth: block tag updates and deletion, while allowing the release workflow to create the tag at publish. This is repository configuration, not enforced by the workflow YAML.
The manual dispatch above remains the override — same pipeline either way.
Pipeline shape
Section titled “Pipeline shape”prepare → build → [e2e ∥ attest] → publish(version, (assets (gates must (draft → tag, to the both pass) latest) draft) draft)| Job | What it does |
|---|---|
prepare |
Resolves the version (scripts/next-version.sh), stages the git tag (local ref — remote materializes at publish), creates or reuses the draft release |
build |
Checks out the release commit and tags it locally, runs unit tests, make release packages, writes checksums.txt, uploads dist/* to the draft with --clobber |
e2e |
Calls e2e-release.yml; one write-scoped staging job downloads the draft assets, then ten read-scoped jobs test per-platform Actions artifact copies of those exact bytes |
attest |
Calls attest-release.yml — generates GitHub build provenance for every asset digest, in an isolated reusable workflow; provenance records origin/integrity, not artifact safety |
publish |
gh release edit --draft=false --latest, then verifies the release and its attestation |
report-failure |
On failure, tells maintainers to check draft/published state before retrying |
Why draft-first (and not prerelease)
Section titled “Why draft-first (and not prerelease)”Two reasons, both verified on the fork:
- Zero public exposure window. Drafts are invisible to everyone without
push access — a failed gate leaves an invisible draft, not a public
prerelease with missing assets.
gh extension installonly seeslatest. - Immutable releases. GitHub’s “Make new releases immutable” locks assets
and the tag at publish — a published prerelease is already locked
(
HTTP 422: Cannot upload assets to an immutable release). Drafts are the only unconditionally mutable state; all asset mutation happens before publish.
Draft specifics that shaped the pipeline:
- Drafts do not create the git tag — it materializes at publish. With
immutable releases enabled the draft binds the tag name: pushing the ref
is evaluated as an update and rejected even for admins (verified on fork).
prepare/buildtherefore tag the release commit locally sogit describe --tags --exact-match(which feedsLDFLAGSin the Makefile) resolves;publishmaterializes the remote tag attarget_commitish. - Downloading draft assets needs
contents: write— a read-onlyGITHUB_TOKENgetsrelease not found. One staging job downloads the assets and uploads per-platform Actions artifacts; the ten E2E jobs use those exact downloaded bytes withcontents: read. Only the staging job has write access; the test jobs still receive the dedicated E2E App credentials for the test step, so those credentials must remain limited to the test organizations.
Version resolution (scripts/next-version.sh)
Section titled “Version resolution (scripts/next-version.sh)”| Input | Behaviour |
|---|---|
version set |
Validated as semver; must be newer than the latest v* tag and not already exist |
bump=patch|minor|major |
Explicit operator selection, applied to the latest tag; requires a prior release tag |
| no version or bump | Rejected — release-please owns automatic conventional-commit version selection |
release_tag (workflow_call) |
Used as-is after validation — this is the release-please path |
Failure and recovery
Section titled “Failure and recovery”- Failure before publish → the release stays a draft; nothing is public.
Fix the cause and re-run with the same version and source commit — the draft
is reused and uploads are
--clobbered. - Tag exists at the wrong commit →
prepareaborts rather than re-tag. - Existing draft targets another commit →
prepareaborts before building; do not mix artifacts from a new commit into an older draft. Cut a new version. - Version already published →
prepareaborts; published releases are never touched. - Failure after publish → immutable release contents and tag cannot be repaired or reused. Cut the next version (normally the next patch); do not retry the published version. Drafts that have not been published can be deleted and recreated.
What the workflow does (build detail)
Section titled “What the workflow does (build detail)”| Step | Command | Purpose |
|---|---|---|
| Checkout | actions/checkout at the main event SHA, fetch-depth: 0 |
Trusted source commit plus history for version validation; build stages the release tag locally before compiling |
| Set up Go | actions/setup-go with go-version-file: go.mod |
Toolchain matches go.mod |
| Test | go test ./... |
Release gate — a failing test aborts the release |
| Build | make release packages |
Produces every asset in dist/ |
| Checksums | sha256sum of dist/* → dist/checksums.txt |
Attestation manifest + manual verification |
| Upload | gh release upload "$TAG" dist/* --clobber |
Attaches everything in dist/ (idempotent re-runs) |
| Attest | actions/attest-build-provenance with subject-checksums |
GitHub build provenance in the repository attestation store; origin/integrity evidence, not a safety verdict |
| Promote | gh release edit "$TAG" --draft=false --latest |
Makes the release installable |
Two environment values drive the version:
VERSION— derived by the Makefile fromgit describe --tags --exact-match(e.g.v1.2.3);PKG_VERSIONstrips the leadingvfor package filenames and metadata.RPM_RELEASE=1— the RPM release/revision number. Bump it manually only if you need to rebuild the same upstream version as a new RPM.
make release itself derives VERSION from git describe --tags --exact-match, which is why the
tag must exist and point at the checked-out commit. Without an exact tag match the Makefile’s VERSION
falls back to the string dev, which then appears in package filenames and metadata.
Known limitation:
--versionis not a release indicator. The Makefile passes-X main.Version,-X main.Commitand-X main.BuildTimeto the linker, but no such variables are defined in the Go code, andmain.goonly callscmd.Execute.cmd/root.gohardcodes the version string1.0.0. Sogh app-auth --versionprints1.0.0for every build, including release binaries, and says nothing about the release. Do not use it, or thedevstring, to verify or troubleshoot a release; validate the release assets, digests and extension metadata as described below.
Assets built during the release
Section titled “Assets built during the release”make release packages writes everything into dist/, and the upload step attaches the whole
directory. A release has exactly 12 assets: 6 binaries, 4 Linux packages, the RPM signing key
(gh-app-auth-rpm-signing.pub) and checksums.txt. For example, the v0.2.0 release lists:
checksums.txt, darwin-amd64, darwin-arm64, gh-app-auth-rpm-signing.pub,
gh-app-auth_0.2.0-1_aarch64.rpm, gh-app-auth_0.2.0-1_x86_64.rpm, gh-app-auth_0.2.0_amd64.deb,
gh-app-auth_0.2.0_arm64.deb, linux-amd64, linux-arm64, windows-amd64.exe and
windows-arm64.exe.
Cross-platform binaries (make release)
Section titled “Cross-platform binaries (make release)”Built from BUILD_MATRIX in the Makefile with CGO_ENABLED=0 for static, dependency-free
binaries:
| Asset | GOOS/GOARCH |
|---|---|
linux-amd64 |
linux/amd64 |
linux-arm64 |
linux/arm64 |
darwin-amd64 |
darwin/amd64 |
darwin-arm64 |
darwin/arm64 |
windows-amd64.exe |
windows/amd64 |
windows-arm64.exe |
windows/arm64 |
The filenames are not cosmetic. gh extension install looks for release assets named exactly
<goos>-<goarch>[.exe] to detect a precompiled extension. Renaming them (for example to
gh-app-auth-linux-amd64) breaks gh extension install AmadeusITGroup/gh-app-auth, which would
silently fall back to a source build or fail. If you add a platform, add it to BUILD_MATRIX and
keep the naming convention.
The Makefile intends to stamp each binary through LDFLAGS:
-X main.Version=$(VERSION) -X main.Commit=$(COMMIT) -X main.BuildTime=$(BUILD_TIME)These flags have no effect, because the Go code defines no such variables (see the known limitation above).
Linux packages (make packages)
Section titled “Linux packages (make packages)”Built with nFPM from the templated nfpm.yaml. envsubst
substitutes ${ARCH}, ${GOARCH}, ${VERSION} and ${RPM_RELEASE} before each nfpm pkg call:
| Asset | Packager | Arch |
|---|---|---|
gh-app-auth_1.2.3_amd64.deb |
deb | amd64 |
gh-app-auth_1.2.3_arm64.deb |
deb | arm64 |
gh-app-auth_1.2.3-1_x86_64.rpm |
rpm | x86_64 |
gh-app-auth_1.2.3-1_aarch64.rpm |
rpm | aarch64 |
gh-app-auth-rpm-signing.pub |
RPM signing key | all |
Package contents (from nfpm.yaml):
/usr/bin/gh-app-auth(mode0755,root:root)/usr/share/doc/gh-app-auth/LICENSE/usr/share/doc/gh-app-auth/README.mdDepends: git,Recommends: gh
Note the differing version conventions: DEB uses 1.2.3, RPM appends the release number as
1.2.3-1.
RPMs are signed during release builds. The matching public key is attached to each release as
gh-app-auth-rpm-signing.pub; Fedora 45 and later require importing it before installing an RPM.
Before trusting it, compare its fingerprint with the value published by project maintainers:
VERSION=v1.2.3curl -fLO "https://github.com/AmadeusITGroup/gh-app-auth/releases/download/${VERSION}/gh-app-auth-rpm-signing.pub"gpg --show-keys --with-fingerprint gh-app-auth-rpm-signing.pubsudo rpm --import gh-app-auth-rpm-signing.pubrpmkeys --checksig --verbose gh-app-auth_1.2.3-1_x86_64.rpmsudo rpm -i gh-app-auth_1.2.3-1_x86_64.rpmThe release workflow requires the RPM_SIGNING_PRIVATE_KEY_B64,
RPM_SIGNING_PASSPHRASE, and RPM_SIGNING_PUBLIC_KEY_B64 repository Actions secrets. The
_B64 values are base64-encoded ASCII-armored OpenPGP exports. The public key is not confidential,
but is stored as a secret for workflow handoff. The private key is decoded only to a temporary
file during package creation; never commit it.
Provisioning the signing key
Section titled “Provisioning the signing key”OpenPGP keys are managed here with GnuPG (gpg). As a trusted maintainer on an encrypted
workstation, generate a unique passphrase with the approved password manager. This creates a
signing-only RSA-4096 key with a two-year expiry; rotate and publish its new fingerprint before
expiry:
install -d -m 700 "$HOME/.gnupg-gh-app-auth-rpm"export GNUPGHOME="$HOME/.gnupg-gh-app-auth-rpm"
( set -euo pipefail read -r -s -p "New RPM signing passphrase: " SIGNING_PASSPHRASE printf '\n' test -n "$SIGNING_PASSPHRASE" printf '%s\n' "$SIGNING_PASSPHRASE" | gpg --batch --pinentry-mode loopback --passphrase-fd 0 \ --quick-generate-key "gh-app-auth RPM signing <opensource@amadeus.com>" rsa4096 sign 2y)
gpg --list-secret-keys --with-fingerprintCopy the full fingerprint (not the short key ID). Export the public key to $HOME; it is not
created in the repository root. Keep this terminal open for the next step so GNUPGHOME and FPR
remain set:
FPR=PASTE_FULL_FINGERPRINT_HEREPUBLIC_KEY="$HOME/gh-app-auth-rpm-signing.pub"gpg --armor --export "$FPR" > "$PUBLIC_KEY"chmod 644 "$PUBLIC_KEY"gpg --show-keys --with-fingerprint "$PUBLIC_KEY"Authenticate gh as a maintainer allowed to manage Actions secrets. This reads the passphrase
without echo, pipes the armored exports directly to GitHub CLI, and does not create a private-key
file or put secret values on the command line:
( set -euo pipefail read -r -s -p "RPM signing passphrase: " SIGNING_PASSPHRASE printf '\n' test -n "$SIGNING_PASSPHRASE"
printf '%s\n' "$SIGNING_PASSPHRASE" | gpg --batch --pinentry-mode loopback --passphrase-fd 0 \ --armor --export-secret-keys "$FPR" | base64 | tr -d '\n' | gh secret set RPM_SIGNING_PRIVATE_KEY_B64 --repo AmadeusITGroup/gh-app-auth gpg --armor --export "$FPR" | base64 | tr -d '\n' | gh secret set RPM_SIGNING_PUBLIC_KEY_B64 --repo AmadeusITGroup/gh-app-auth printf '%s' "$SIGNING_PASSPHRASE" | gh secret set RPM_SIGNING_PASSPHRASE --repo AmadeusITGroup/gh-app-auth)Confirm the three secret names with gh secret list --repo AmadeusITGroup/gh-app-auth; values are
not displayed. Keep the passphrase in the approved password manager. Back up the
passphrase-protected GPG home and $GNUPGHOME/openpgp-revocs.d/<FPR>.rev to access-controlled,
encrypted offline storage; keep the passphrase separate from that backup. Restrict who can change
release workflows or manage repository secrets. The public key can be distributed; the release
workflow publishes it with each release.
Rotating the signing key
Section titled “Rotating the signing key”Rotate before expiry. If compromised, revoke the old key immediately with its revocation
certificate and publish a notice. Generate a replacement using the steps above and publish its full
fingerprint. In one maintenance window, replace all three Actions secrets with values from that
keypair; do not run a release until all are updated. Validate with the release workflow’s
dry_run: true and confirm Fedora signature checks pass (the dry run leaves a draft release).
Keep prior public keys and fingerprints with existing releases; normal expiry alone does not
require revocation.
Release checklist
Section titled “Release checklist”Before merging the release-please PR (or running an explicit manual override):
mainis green in CI (test matrix, lint, security, CodeQL)make qualitypasses locally- RPM signing Actions secrets are configured and the public-key fingerprint is published
- Review the release-please PR’s generated
CHANGELOG.mdsection and edit release notes there if needed - Version number follows Semantic Versioning and matches the commit types
since the last tag: breaking change → major (minor while
0.x),feat→ minor,fix→ patch - Any breaking change or significant new feature has an ADR
- Docs (
README.md,docs/) reflect new or changed commands and flags
Verifying a release
Section titled “Verifying a release”# Exactly the 12 expected assets present?gh release view v1.2.3 --repo AmadeusITGroup/gh-app-auth --json assets --jq '.assets[].name'
# Release is published (not a draft)?gh release view v1.2.3 --repo AmadeusITGroup/gh-app-auth --json isDraft,isPrerelease
# Download the assets and check them against checksums.txt (Linux)verify_dir="$(mktemp -d)"gh release download v1.2.3 --repo AmadeusITGroup/gh-app-auth --dir "$verify_dir"(cd "$verify_dir" && sha256sum --check checksums.txt)checksums.txt is written by cd dist && sha256sum -- * | tee checksums.txt. That command does not
guarantee that the manifest excludes itself: a pre-existing manifest can match the wildcard, and a clean build
is expected. sha256sum --check checks the entries as written and exits non-zero on any mismatch or missing
file; if it fails on the manifest’s own entry, investigate it rather than ignoring the failure. On macOS use shasum -a 256 --check.
To check what gh extension install selects, run the check in a subshell with a job-owned home, so it
does not depend on latest and leaves your own installed extension and environment untouched. The
subshell closes afterwards, so your original environment stays intact:
( export HOME="$(mktemp -d)" export GH_CONFIG_DIR="$HOME/.config/gh" export XDG_DATA_HOME="$HOME/.local/share" gh extension install AmadeusITGroup/gh-app-auth --pin v1.2.3 gh extension list)A fresh profile has no login, so make GH_TOKEN available in your environment before running it.
Verify build provenance with gh attestation verify as your policy requires. gh app-auth --version is
deliberately not part of this check: it prints a hardcoded value (see the known limitation above).
# DEB installs directly; RPM requires importing its release public key firstsudo dpkg -i "$verify_dir/gh-app-auth_1.2.3_amd64.deb"dpkg -L gh-app-authLocally, make validate-packages cross-checks that each binary and package really carries the
architecture its filename claims.
Building assets locally
Section titled “Building assets locally”Useful to reproduce a release build or debug a packaging failure:
# Binaries for all platforms (runs `clean` first — wipes dist/)make release
# Everything the release workflow buildsVERSION=1.2.3 RPM_RELEASE=1 make release packages
# Only your own architecture (fastest)make packages-local
# Confirm architectures match filenamesmake validate-packagesmake release depends on clean, which removes dist/, the local gh-app-auth binary, and
coverage files. make packages also runs dev-setup, which sets your local
git config commit.template.
Packaging needs envsubst (gettext-base on Debian/Ubuntu, gettext on Fedora/RHEL). nfpm is
fetched on demand via go run, so no separate install is required.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
prepare fails: “tag exists at a different commit” |
The version is already bound to another source commit | Pick a new version; never move a published tag |
prepare fails: “already published” |
That version was already released | Bump the version — published releases are never touched |
| E2E fails before publish | Infra issue or real regression | Release stays a draft; fix and re-run the same version from the same main commit |
Package filenames contain dev instead of the version |
git describe --tags --exact-match found no tag on HEAD, or checkout lacked full history |
Ensure the tag points at the released commit and fetch-depth: 0 is set. --version output is unrelated: it is hardcoded |
envsubst: command not found |
Missing gettext-base |
Install it (gettext-base on Debian/Ubuntu) |
gh extension install builds from source instead of downloading |
Asset names do not match <goos>-<goarch> |
Restore the BUILD_MATRIX naming |
| Upload rejected as duplicate | Asset already attached from an earlier run | Already handled by --clobber; if editing manually, delete the asset first |
| Wrong architecture inside a package | nfpm.yaml templating or GOARCH mismatch |
Run make validate-packages to locate the mismatch |
Related documentation
Section titled “Related documentation”.github/workflows/release.yml— the workflow itselfMakefile—release,packages,packages-local,validate-packagestargetsnfpm.yaml— DEB/RPM package definition- CONTRIBUTING.md — conventional commits, which drive version selection
- Installation Guide — how users consume these assets
- ADR index — record the decisions behind notable changes in a release