Releasing
Releases are cut from GitHub Actions in one click. Write user-visible changes under ## [Unreleased] in CHANGELOG.md as you go (Keep a Changelog format, semantic versioning).
Cutting a release
Run Actions → release → Run workflow on main with a version: X.Y.Z, or patch / minor / major to bump the latest tag. Tick dry run to build everything without publishing. The workflow:
- runs
make verify GOLANGCI= MDLINT=(golangci-lint and markdownlint run in CI on every push instead); - runs
tools/relprep, which turns[Unreleased]into[X.Y.Z] - <date>, pins the version in the Composer launcher (composer/custos) and extracts the release notes; then commitsRelease vX.Y.Z, tags it and pushes; - runs goreleaser (
.goreleaser.yaml): archives, bare binaries andSHA256SUMSon the GitHub release, and the cask injanalis/homebrew-tap; - lets Packagist pick up the tag (and pings it when its secrets are set);
- rebuilds and deploys this documentation site, so the changelog and the version in the navigation bar are current.
Release notes join the changelog's source-wrapped prose while preserving lists, code blocks and explicit line breaks. To reformat an existing notes file, run go run ./tools/relprep -format-notes notes.md > formatted.md; the original file is left intact.
A failed publish can be retried with Re-run failed jobs; the tag is kept.
To build a snapshot locally:
go run github.com/goreleaser/goreleaser/v2@latest release --snapshot --clean --skip=publishBranches
Work lands on develop, the default branch; main holds what was last released. The repository deletes the head branch of a merged pull request, except main, which the Keep main ruleset protects from deletion: the release workflow needs it. Moving both branches by fast-forward needs no pull request:
git fetch origin
git push origin origin/develop:refs/heads/main # before the release
# Actions → release → Run workflow on main
git fetch origin
git push origin origin/main:refs/heads/develop # after: develop gets the release commitThe second push fails if develop moved during the release; merge origin/main into develop locally then, and push develop.
Documentation site
The site is built with VitePress from docs/ and deployed to GitHub Pages by .github/workflows/docs.yml: on every push to main that touches docs/, specs/, CHANGELOG.md, internal/inspection/meta/, tools/rulesref/ or tools/internal/, after each release, and on demand (Run workflow). Pull requests build it without deploying, which catches dead links. The build also fails when the public rule pages (docs/rules/ and the rules sidebar, generated by tools/rulesref) differ from what make rules-doc produces; docs/internals/rules.md and the explain texts are not checked there.
make docs-dev # live preview on http://localhost:5173/custos/
make docs # production build in docs/.vitepress/distOne-time setup
- Create the empty
janalis/homebrew-taprepository and theHOMEBREW_TAP_TOKENsecret: a fine-grained token with Contents: read and write on that repository only. - Submit
https://github.com/janalis/custoson packagist.org; its GitHub hook then updates on every tag. Optionally add thePACKAGIST_USERNAMEandPACKAGIST_TOKENsecrets. - If
mainis protected, let GitHub Actions bypass the protection so the release commit can be pushed. - Settings → Pages → Build and deployment → Source: GitHub Actions.
- Optionally upload
docs/public/og.pngas the repository's social preview (Settings → General → Social preview).
