Releasing
lttr is a private Go module. A release is a Git tag and nothing else: there is no registry and no build artefact. Consumers resolve the tag directly from GitHub. .github/workflows/release.yml computes the next version, proves the tag is consumable, and writes the release notes. An untagged change is invisible to every consumer.
Cut the first release
The repository has no tags yet. The source tree is v0.2.0: CHANGELOG.md has a v0.2.0 section and lttr.Version is "v0.2.0". The v0.1.0 in the changelog was never tagged.
With no tag, the workflow counts versions from 0.0.0 over every commit, so its computed version would be v0.1.0, not v0.2.0. The first push to main that touches a shipped file would start that computation and tag v0.1.0 on the v0.2 code. Cut the first release by hand before that happens, with an explicit version:
gh workflow run release.yml -f version=v0.2.0
Every gate still runs: verify, tag, consume, and roll back on failure. Rehearse it first with -f dry_run=true added (see Rehearse with a dry run). Once v0.2.0 exists, later versions are computed from it: the next feat: makes v0.3.0, the next fix: v0.2.1.
Write commits the release notes can read
The version bump and the release notes both come from Conventional Commits subject lines:
type(scope): description
| Subject | Bump |
|---|---|
feat: | Minor |
fix:, perf:, refactor: | Patch |
docs:, chore:, test:, ci:, anything else | None on its own |
! after the type (feat!:, fix!:), or a BREAKING CHANGE: line in the body | Marks the release as breaking. A patch becomes a minor, and it never goes major (see the pre-1.0 policy) |
The scope is optional and reads best as the package: feat(kit): content shape rules in component schemas, fix(plain): quoted font stacks in style attributes. The notes are written by changelogithub, which groups commits by type. A subject that isn't in this format doesn't count towards the bump and is left out of the notes.
Know what starts a release
A push to main starts the workflow only when it touches a file that ships in the module:
**.go,go.modandgo.sumkits/**: the kit files thatkits/plainandkits/quietembed (kit.yaml, layouts, styles, blocks, component templates, assets and samples)examples/**.mdandexamples/quiet/assets/**, the example templates and images**.tmpl, any template file elsewhere
A push that only changes documentation, the docs site or the Makefile doesn't start a run. Its commits aren't lost, though: the version is computed from every commit since the last tag, so a feat: that only touched Markdown still counts at the next run that does start.
Runs share one concurrency group, and a run in progress is never cancelled, so two pushes to main can't race to create the same tag.
Follow a release through the workflow
Plan the version
The plan job reads the subject lines since the latest v* tag. With no tag it starts from 0.0.0 and reads every commit. The highest bump present wins. If there is no feat, fix, perf or refactor commit, or the computed tag already exists, the run stops with nothing released and says why in the run summary. A run started with version skips the computation and uses that version.
Verify the source
The verify job checks that go mod tidy leaves go.mod and go.sum unchanged, then runs make check: gofmt, vet, staticcheck, the race tests, the 85% coverage floor and a fuzz smoke run. It is the same gate ci.yml runs on pushes to main and on pull requests.
Tag
The tag job creates an annotated tag on the commit that started the run and pushes it.
Consume the published tag
The consume job builds a throwaway module outside the repository, as a consumer would. It sets GOPRIVATE='github.com/sulv-io/*', points Git at the repository with the workflow's token, and runs go get github.com/sulv-io/lttr@<tag>. Its program imports every documented package (lttr, comark, data, ir, kit, kits/plain, kits/quiet, render, render/html, render/text and examples/quiet), builds a Renderer from quiet.Config, and renders the nine Loam examples to HTML, text and MIME:
consumer OK: 9 templates
Before running it, the job asserts that go list -m still resolves lttr to the tag under test. When a tag can't satisfy an import, go mod tidy doesn't fail. It quietly moves to a newer tag that can, and the check would pass against the wrong version. The job also reports the module zip's size in the run summary.
This is the only step that exercises a consumer's real path: proxy bypass, Git authentication, tag resolution and the contents of the module zip, the embedded kit files included. A build inside the repository proves none of it, because a local checkout satisfies every import whatever the tag contains.
Roll back or publish
If consume fails, the rollback job deletes the tag again and no release is published. Consumers fetch lttr directly from GitHub with no proxy cache, so deleting the ref really does withdraw the version. If consume passes, publish runs changelogithub@0.13 from the previous tag to the new one and creates the GitHub release. For the first release there is no previous tag, so it passes only --to.
go list -m github.com/sulv-io/lttr after go mod tidy. If the version isn't the tag you meant to test, tidy has upgraded past it and your check proves nothing.Rehearse with a dry run
Start the workflow by hand with dry_run set:
gh workflow run release.yml -f dry_run=true
A dry run plans and verifies as usual. It verifies even when there is nothing to release. Then, instead of tagging, the consume-local job runs the same consumer program against the checked-out source through a replace directive, and asserts that lttr resolved to the checkout. The tag, consume, rollback and publish jobs are skipped. Nothing is tagged, pushed or published.
A dry run proves that the import paths resolve, and that the Quiet kit loads and the examples compile and render, from a clean module. It can't prove tag resolution, proxy bypass or the module zip's contents. Only a real release's consume job can.
Force a version
To release an exact version, run the workflow with version:
gh workflow run release.yml -f version=v0.2.0
The version is used as given, and every gate still runs, so a forced tag that can't be consumed is rolled back like any other. The path filter applies only to pushes: a manual run always starts. Without version, it still computes the version and can end with nothing released. Combine version with dry_run=true to rehearse a forced version.
Stay below v1.0.0
lttr is pre-1.0: the API can still change between minor versions, as v0.2.0 did.
- A breaking change (
feat!:,fix!:or aBREAKING CHANGE:footer) is released as a minor bump, and the run summary says so. Consumers on the previous version aren't broken bygo getalone, only when they upgrade. See Migrating from v0.1 for what the last one changed. - The workflow never goes major on its own.
v1.0.0is a deliberate act: run it by hand withversion=v1.0.0. - Past
v1, Go treats each major version as its own module path. Taggingv2.0.0whilego.modstill saysmodule github.com/sulv-io/lttrproduces a tag Go refuses to resolve, so a major bump means changing the module path to…/lttr/v2and every import first.
CHANGELOG.md records notable changes by hand until v1.0.0. After that, the generated release notes are the record.
Keep lttr.Version in step
lttr.Version is a constant maintained by hand, and it is "v0.2.0" now. The workflow tags commits but doesn't rewrite it. When a release changes the API, bump it in the same change as the CHANGELOG.md entry, to the version the release will get. The Git tag is still the authority: to know which version a program runs, read the module graph (go list -m github.com/sulv-io/lttr, or debug.ReadBuildInfo at run time).
Consume a release
A consuming service pins a released tag:
go env -w GOPRIVATE='github.com/sulv-io/*'
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/sulv-io/".insteadOf "https://github.com/sulv-io/"
go get github.com/sulv-io/lttr@v0.2.0
The token must be able to read sulv-io/lttr. Inside the workflow, github.token is enough because it reads its own repository. A service in another repository needs a token of its own.
Pin a tag in the service's go.mod. A replace directive pointing at a local checkout is fine while developing against an unreleased change, but it shouldn't reach the service's main. Fix a defect here, test-first, and ship it as a new tag.
Know what ships
The module zip is built from the repository tree at the tagged commit, so everything committed there is downloaded by every consumer: the kits in kits/ with their assets and samples, examples/quiet with its templates and images, examples/tutorial, the golden files and the documentation. Test files ship too, but they are compiled only when someone runs the module's own tests.
Migrating from v0.1
What v0.2.0 removed and renamed, what replaces families, themes, streams and placeholders, and a v0.1 program ported step by step.
API reference
Every exported identifier of lttr, kit, lint, data and the two shipped kits, and the render and ir error types, package by package, with its signature and what it does.