GoReleaser — Release Engineering for Go Projects
GoReleaser automates the entire Go release process: cross-compilation for all platforms, Docker image building, Homebrew formula generation, changelog creation, and publishing to GitHub/GitLab releases — all from a single YAML config.
What it is
GoReleaser is an open-source tool that automates the full release pipeline for Go projects. A single goreleaser release command cross-compiles your binary for Linux, macOS, Windows, and ARM, creates archives, generates checksums, builds Docker images, creates Homebrew and Scoop formulas, publishes to GitHub or GitLab Releases, and generates changelogs.
GoReleaser targets Go developers and teams who want repeatable, automated releases without writing custom shell scripts or CI pipeline steps for each artifact type.
How it saves time or tokens
Without GoReleaser, releasing a Go project to multiple platforms requires separate build scripts, archive commands, Docker builds, and package manager formula generators. GoReleaser replaces all of this with a single YAML config file. The snapshot mode lets you test the entire pipeline locally before tagging a real release, catching issues before they hit CI.
How to use
- Install GoReleaser:
brew install goreleaser
- Initialize the config in your project root:
goreleaser init
- Test locally without publishing:
goreleaser release --snapshot --clean
- Tag and release:
export GITHUB_TOKEN=ghp_xxx
git tag v1.0.0
git push origin v1.0.0
goreleaser release --clean
Example
A .goreleaser.yaml that builds for multiple platforms and creates a Homebrew tap:
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
archives:
- format: tar.gz
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
brews:
- repository:
owner: myorg
name: homebrew-tap
homepage: https://github.com/myorg/myproject
description: My Go project
changelogs:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
Related on TokRepo
- DevOps automation tools — CI/CD and release automation
- Coding tools — developer productivity tooling
Common pitfalls
- Forgetting to set
CGO_ENABLED=0for cross-compilation; CGo dependencies break builds on non-native platforms - Not testing with
--snapshotbefore tagging; a failed release aftergit push --tagsrequires manual cleanup on GitHub - Using GoReleaser Pro features in the open-source version; check the docs for which features require a license
Frequently Asked Questions
Yes. GoReleaser supports GitHub, GitLab, and Gitea as release targets. You configure the provider in .goreleaser.yaml and set the corresponding token environment variable (GITLAB_TOKEN for GitLab).
Yes. GoReleaser has a dockers section in the config that builds and pushes Docker images as part of the release. It supports multi-platform images via buildx and can push to any container registry.
GoReleaser OSS is free and covers most release needs. GoReleaser Pro adds features like monorepo support, custom publishers, nightly builds, and Homebrew caveats. The OSS version handles the majority of single-repo Go projects.
GoReleaser generates changelogs from git commit messages between the current and previous tags. You can filter commits by prefix (e.g., exclude docs: and test: commits), group them by type, and customize the format in the config.
Yes. GoReleaser provides an official GitHub Action (goreleaser/goreleaser-action) that handles installation and execution. You trigger it on tag push events and pass GITHUB_TOKEN for publishing permissions.
Citations (3)
- GoReleaser GitHub— GoReleaser automates Go release pipelines
- GoReleaser Docs— GoReleaser supports GitHub Actions for CI integration
- Go Documentation— Cross-compilation with CGO_ENABLED=0 for Go
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.