Skip to content

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.

Terminal window
# 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=minor
gh workflow run release.yml --ref main -f version=v1.2.3
gh workflow run release.yml --ref main -f version=v1.2.3 -f dry_run=true
# Watch and verify
gh run watch
gh release view v1.2.3

Equivalent 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.

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": true in release-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 on main.
  • Release-please is authoritative for automatic version selection from conventional commits. .release-please-manifest.json tracks its current version and the release PR updates the generated changelog.
  • Manual dispatch is an explicit operator override: supply version or bump=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 (run gh workflow run release-please.yml --ref main to refresh it if needed).
  • While the project is 0.x, bump-minor-pre-major keeps breaking changes on a minor bump rather than jumping to 1.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 main once 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.

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

Two reasons, both verified on the fork:

  1. 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 install only sees latest.
  2. 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/build therefore tag the release commit locally so git describe --tags --exact-match (which feeds LDFLAGS in the Makefile) resolves; publish materializes the remote tag at target_commitish.
  • Downloading draft assets needs contents: write — a read-only GITHUB_TOKEN gets release not found. One staging job downloads the assets and uploads per-platform Actions artifacts; the ten E2E jobs use those exact downloaded bytes with contents: 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 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 → prepare aborts rather than re-tag.
  • Existing draft targets another commit → prepare aborts before building; do not mix artifacts from a new commit into an older draft. Cut a new version.
  • Version already published → prepare aborts; 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.
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 from git describe --tags --exact-match (e.g. v1.2.3); PKG_VERSION strips the leading v for 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: --version is not a release indicator. The Makefile passes -X main.Version, -X main.Commit and -X main.BuildTime to the linker, but no such variables are defined in the Go code, and main.go only calls cmd.Execute. cmd/root.go hardcodes the version string 1.0.0. So gh app-auth --version prints 1.0.0 for every build, including release binaries, and says nothing about the release. Do not use it, or the dev string, to verify or troubleshoot a release; validate the release assets, digests and extension metadata as described below.

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.

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).

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 (mode 0755, root:root)
  • /usr/share/doc/gh-app-auth/LICENSE
  • /usr/share/doc/gh-app-auth/README.md
  • Depends: 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:

Terminal window
VERSION=v1.2.3
curl -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.pub
sudo rpm --import gh-app-auth-rpm-signing.pub
rpmkeys --checksig --verbose gh-app-auth_1.2.3-1_x86_64.rpm
sudo rpm -i gh-app-auth_1.2.3-1_x86_64.rpm

The 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.

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:

Terminal window
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-fingerprint

Copy 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:

Terminal window
FPR=PASTE_FULL_FINGERPRINT_HERE
PUBLIC_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:

Terminal window
(
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.

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.

Before merging the release-please PR (or running an explicit manual override):

  • main is green in CI (test matrix, lint, security, CodeQL)
  • make quality passes locally
  • RPM signing Actions secrets are configured and the public-key fingerprint is published
  • Review the release-please PR’s generated CHANGELOG.md section 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
Terminal window
# 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:

Terminal window
(
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).

Terminal window
# DEB installs directly; RPM requires importing its release public key first
sudo dpkg -i "$verify_dir/gh-app-auth_1.2.3_amd64.deb"
dpkg -L gh-app-auth

Locally, make validate-packages cross-checks that each binary and package really carries the architecture its filename claims.

Useful to reproduce a release build or debug a packaging failure:

Terminal window
# Binaries for all platforms (runs `clean` first — wipes dist/)
make release
# Everything the release workflow builds
VERSION=1.2.3 RPM_RELEASE=1 make release packages
# Only your own architecture (fastest)
make packages-local
# Confirm architectures match filenames
make validate-packages

make 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.

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