Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Automation & toolingMixed 22 series

Release automation commands

The commands do not make a release safe. The order does.

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 minor

Build

go build -trimpath -ldflags="-s -w"
python -m build --sdist --wheel
docker buildx build --push -t api:v1.4.0 .
goreleaser release --snapshot --clean

Sign

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 SHA256SUMS

Publish

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

In 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 --snapshot

Explained

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?

More notes: Automation & tooling

Open in the notes app: search, filters, copy This note on GitHub