Skip to content

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:

  1. runs make verify GOLANGCI= MDLINT= (golangci-lint and markdownlint run in CI on every push instead);
  2. 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 commits Release vX.Y.Z, tags it and pushes;
  3. runs goreleaser (.goreleaser.yaml): archives, bare binaries and SHA256SUMS on the GitHub release, and the cask in janalis/homebrew-tap;
  4. lets Packagist pick up the tag (and pings it when its secrets are set);
  5. 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:

sh
go run github.com/goreleaser/goreleaser/v2@latest release --snapshot --clean --skip=publish

Branches ​

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:

sh
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 commit

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

sh
make docs-dev       # live preview on http://localhost:5173/custos/
make docs           # production build in docs/.vitepress/dist

One-time setup ​

  • Create the empty janalis/homebrew-tap repository and the HOMEBREW_TAP_TOKEN secret: a fine-grained token with Contents: read and write on that repository only.
  • Submit https://github.com/janalis/custos on packagist.org; its GitHub hook then updates on every tag. Optionally add the PACKAGIST_USERNAME and PACKAGIST_TOKEN secrets.
  • If main is 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.png as the repository's social preview (Settings → General → Social preview).

Released under the MIT License. Native rules and rules modeled on Php Inspections (EA Extended); independent clean-room implementation.