goreleaser-setup
npx machina-cli add skill a5c-ai/babysitter/goreleaser-setup --openclawFiles (1)
SKILL.md
907 B
Goreleaser Setup
Set up goreleaser for Go release automation.
Generated Patterns
# .goreleaser.yaml
version: 2
builds:
- env: [CGO_ENABLED=0]
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
ldflags:
- -s -w -X main.version={{.Version}}
archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
changelog:
sort: asc
filters:
exclude: ['^docs:', '^test:', '^chore:']
brews:
- repository:
owner: myuser
name: homebrew-tap
homepage: https://github.com/myuser/myapp
description: My CLI application
Target Processes
- cli-binary-distribution
- package-manager-publishing
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/specializations/cli-mcp-development/skills/goreleaser-setup/SKILL.mdView on GitHub Overview
Automate cross-platform Go releases with Goreleaser. This setup configures builds, archives, and publishing steps to deliver Linux, Windows, and macOS binaries across amd64 and arm64, while embedding version data.
How This Skill Works
The skill generates a .goreleaser.yaml that defines builds with CGO_ENABLED=0, targets goos: linux, windows, darwin; goarch: amd64, arm64; ldflags to inject version. It also configures archives formats tar.gz and zip for Windows, a checksum name_template, changelog filters, and a Homebrew tap entry. Running Goreleaser uses this config to compile, package, and publish release artifacts.
When to Use It
- Release a multi-architecture Go CLI across Linux, Windows, and macOS.
- Publish release assets as tar.gz or zip per OS.
- Generate and publish checksums for artifact integrity.
- Embed version information into binaries at build time.
- Automate packaging for Homebrew taps.
Quick Start
- Step 1: Create a .goreleaser.yaml and populate builds, archives, checksum, changelog, and brews sections as shown.
- Step 2: Run goreleaser release --rm-dist to build and publish artifacts.
- Step 3: Verify release assets, checksums, and Homebrew tap configuration.
Best Practices
- Pin goreleaser version in CI to ensure reproducible builds.
- Test cross-target builds locally before publishing.
- Configure changelog filters to avoid leaking internal docs or tests.
- Use ldflags to inject precise version strings.
- Review Windows archive overrides to ensure correct formats.
Example Use Cases
- Cross-compile linux, windows, and macOS binaries for amd64 and arm64.
- Produce tar.gz archives for most targets and zip for Windows.
- Generate and publish checksums named checksums.txt.
- Filter changelog entries to exclude docs and tests.
- Publish artifacts to a Homebrew tap with an owner and homepage.
Frequently Asked Questions
Add this skill to your agents