Skip to content

Build release binaries with GoReleaser - #44

Merged
taskinen merged 1 commit into
mainfrom
ci/goreleaser
Oct 16, 2026
Merged

taskinen merged 1 commit into
mainfrom
ci/goreleaser

Conversation

@taskinen

Copy link
Copy Markdown
Owner

Why

Mailbox Zero will be released as v1.0.0, installable in two ways:

  • go install github.com/taskinen/mailboxzero@latest, which needs only a version tag;
  • ready-built binaries attached to the GitHub release, for people without Go.

This is the second of three PRs before the release:

  1. Prepare the binary for installing: version, example config, config location #43, the flags;
  2. this PR, the release builds;
  3. the README install instructions.

Changes

.goreleaser.yaml (GoReleaser v2):

  • Builds the six combinations of linux, macOS and Windows with amd64 and arm64.
  • Packs each binary with LICENSE, README.md and config.yaml.example into its own folder: .tar.gz, or .zip for Windows.
  • Adds checksums.txt.
  • Changelog generation is off: release notes are written by hand.
  • The release is matched by its name (Mailbox Zero vX.Y.Z). GoReleaser adds the archives to the existing draft, keeps its notes and publishes it. Re-runs replace archives already uploaded.

.github/workflows/release.yml, on a pushed vX.Y.Z tag:

  • runs go test, with no build cache for release builds;
  • then runs GoReleaser, which builds, uploads to the draft and publishes.

So a release is never public without its binaries.

test.yml: a new "Check Release Config" job runs goreleaser check on every push. It takes a few seconds, so a broken .goreleaser.yaml shows up on the PR instead of at release time.

.gitignore: dist/. Go counts untracked files as uncommitted changes. Without this line, the release binaries would be stamped +dirty and GoReleaser would refuse to build.

CLAUDE.md:

  • A new Releasing section: draft, tag, workflow, checks, and the rule never to move a published tag (the Go proxy keeps every version for good).
  • The project tree, the Version line, and a note on GoReleaser's floating v2 version.

Checked locally (GoReleaser v2.18.3)

  • goreleaser check: the config is valid.
  • goreleaser release --snapshot --clean:
    • six archives plus checksums.txt;
    • each unpacks into mailboxzero_<version>_<os>_<arch>/ with the binary, LICENSE, README.md and config.yaml.example;
    • dist/ stays out of git status.
  • The version stamp, in a throwaway clone with a local-only tag (never pushed):
    • goreleaser build (non-snapshot, with all its git checks) accepted the tag and the clean tree.
    • go version -m on the binary showed mod github.com/taskinen/mailboxzero v1.0.0-stamptest and vcs.modified=false. So release binaries will report their tag.
    • Side finding: a tag must be v0 or v1 for this module path. Go ignored a v9.9.9 test tag, because v2+ needs a /v2 module path.
  • actionlint: passes, apart from the ubuntu-26.04 runner label, which its release doesn't know yet.

The release workflow itself first runs when v1.0.0 is tagged.

Releases will be installable with go install, which needs only a tag,
and as ready-built binaries for people without Go.

- .goreleaser.yaml builds linux, macOS and Windows binaries for amd64
  and arm64 and packs each with LICENSE, README.md and
  config.yaml.example, plus checksums.txt. There are no -X flags: a
  binary reports the tag from the build information Go records in it.
- .github/workflows/release.yml runs on a pushed vX.Y.Z tag: it runs
  the tests, builds, adds the archives to the draft release of that
  version and publishes it with its handwritten notes. Publishing only
  after the archives are there means a release is never public while
  incomplete.
- A "Check Release Config" job runs goreleaser check on every push.
- dist/ is ignored: Go counts untracked files as uncommitted changes
  and would stamp the binaries +dirty.

CLAUDE.md gets a Releasing section with the steps.
@taskinen
taskinen merged commit 1422342 into main Oct 16, 2026
8 checks passed
@taskinen
taskinen deleted the ci/goreleaser branch October 16, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant