ADR-004: Use Goreleaser with Auto-Tagging for Release Automation

Status

Accepted

Date

2026-07-10

Context

We need to automate the release process for stamp. Key requirements:

Decision

Release Pipeline

Use two complementary workflows:

  1. Auto (default): auto-tag.yml triggers on push to main. Uses thenativeweb/get-next-version to calculate the next version from conventional commits since the last tag. Creates a local git tag, then runs goreleaser to build and publish.

  2. Manual (fallback): release.yml triggers on v* tag push. Runs goreleaser directly for hotfix releases from specific commits.

Version Calculation

thenativeweb/get-next-version with prefix: 'v':

Tag Strategy

Build Matrix

Version Injection

Version, commit hash, and build date are injected at build time via ldflags:

-X github.com/rossijonas/stamp/internal/cli.Version={{.Version}}
-X github.com/rossijonas/stamp/internal/cli.Commit={{.Commit}}
-X github.com/rossijonas/stamp/internal/cli.Date={{.Date}}

Alternatives Considered

Custom Bash Script for Versioning

semantic-release (Node.js)

Manual Tagging Only

Consequences