- Updated AGENTS.md and README.md to clarify the automated release process using release-please and GoReleaser. - Added a version command to the envc CLI to display build metadata. - Included CI/CD details in README for better understanding of testing and release automation.
3.3 KiB
3.3 KiB
ASR-0009: CI/CD pipeline and automated semantic versioning
Context
ASR-0008 only covered GitHub presentation and the initial manual tag of v0.1.0.
The project needs continuous verification on every PR and a release flow that does
not require humans to bump version strings. The source tree must stay free of
version literals (the CHANGELOG aside) so that go install …@latest and GoReleaser
artefacts agree on a single source of truth: git tags.
Decision
- Test pipeline (
.github/workflows/test.yml): matrix of Go1.22,1.23, andstableonubuntu-latestplus onestablerun on macOS and Windows, withgo test -race -shuffle=on -count=1 -coverprofile=coverage.out. Coverage is uploaded to Codecov from the Linuxstableleg only.go mod tidyis enforced viagit diff --exit-code. - Lint pipeline (
.github/workflows/lint.yml):go vetplusgolangci-lint@v6using the repo's existing.golangci.yml. - Automated SemVer (
.github/workflows/release-please.yml+release-please-config.json+.release-please-manifest.json): Google's release-please-action inrelease-type: gomode parses Conventional Commits since the previous tag and opens a "chore: release vX.Y.Z" PR that editsCHANGELOG.mdand the manifest only. Merging the PR creates the git tag. The manifest is seeded with the current0.2.0so history is continuous. - Release pipeline (
.github/workflows/release.yml+.goreleaser.yml): onpush: tags: ["v*"], GoReleaser v2 cross-compilescmd/envcfor linux/darwin/windows × amd64/arm64 (no windows/arm64), stamps-X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}into the binary, producestar.gz/ziparchives pluschecksums.txt, and attaches them to a GitHub Release whose body is generated from commit groups (feat,fix,perf, …). - No version literals in Go code.
cmd/envc/main.godefinesvar version = "dev"(andcommit,date), overridable only at link time.envc versionprints whatever the release build injected; localgo installbuilds reportdev. - Dependency hygiene (
.github/dependabot.yml): weeklygomodandgithub-actionsupdates, grouped for minor/patch, with conventionalchore(deps)/ci(actions)commit prefixes so release-please classifies them correctly.
Consequences
- Contributors must use Conventional Commits; otherwise release-please will not
bump the version.
chore:/docs:/ci:commits produce no release. - Breaking changes require
feat!:or aBREAKING CHANGE:footer, which release-please maps to a major bump (subject tobump-minor-pre-major: truewhile the module is pre-1.0). - Re-tagging a release manually is discouraged — the tag is the contract that triggers GoReleaser.
- Codecov token (
CODECOV_TOKEN) and branch protection enforcing the Tests and Lint checks must be configured in the GitHub repository settings (operational, not code).
Status
Accepted — 2026-05-02.