Quick reference
Version, build, sign, publish: four blocks, one tag.
Version
git describe --tags --always
git tag -s v1.4.0 -m "release"
git-cliff --tag v1.4.0 -o CHANGELOG.md
npm version minorBuild
go build -trimpath -ldflags="-s -w"
python -m build --sdist --wheel
docker buildx build --push -t api:v1.4.0 .
goreleaser release --snapshot --cleanSign
cosign sign ghcr.io/acme/api:v1.4.0
syft dir:. -o spdx-json > sbom.json
trivy image ghcr.io/acme/api:v1.4.0
sha256sum -c SHA256SUMSPublish
gh release create v1.4.0 --generate-notes
gh release upload v1.4.0 dist/*
twine upload dist/*
oras push ghcr.io/acme/api:v1.4.0 sbom.jsonIn one line: A release is a rehearsed run. The tag is the input; a signed digest is the output.
Cut a dry run:
goreleaser release --snapshotExplained
Version. git describe tells you what you are actually building, which is rarely the tag someone typed in chat. A signed tag, git tag -s, is the one claim you can verify later. git-cliff turns the commits since the last tag into a changelog.
Build. Reproducible flags, a clean tree and one artefact per platform. go build -trimpath removes the local path from the binary, python -m build produces the sdist and wheel from the same source, and docker buildx builds and pushes the image from one command. goreleaser --snapshot gives you the whole pipeline without a tag.
Sign. cosign signs the digest, not the tag, because tags move. syft writes the SBOM, trivy reads the image for vulnerabilities, and sha256sum -c proves the file you downloaded is the file you built.
Publish. gh release create generates the notes and publishes the release, twine uploads the wheel, and oras pushes the SBOM next to the image. Every artefact has a digest in the release notes.
The honest caveat: automation makes a bad release faster too. A green pipeline still ships the bug you did not test, and provenance only proves where it came from.
The lesson: rehearse the release before the tag exists.
Your turn: Which of the four blocks is still a manual step for you?
Related on this site
More notes: Automation & tooling
- P1060Five rules for credential automation
- P1059Observability as code
- P1058Scaffolding a new service from a template
- P1057Four numbers for automation
- P1056Idempotent scripts and safe re-runs
- P1055Cron to systemd timer: the migration path
- P1054Five signs your automation is fragile
- P1053Designing a CLI people keep using
Open in the notes app: search, filters, copy This note on GitHub