Learn-skills.dev goreleaser
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/aaronflorey/agent-skills/goreleaser" ~/.claude/skills/neversight-learn-skills-dev-goreleaser && rm -rf "$T"
manifest:
data/skills-md/aaronflorey/agent-skills/goreleaser/SKILL.mdsource content
GoReleaser Skill
GoReleaser automates the release process for software projects. It builds binaries, creates archives, publishes to package managers, builds Docker images, and generates changelogs.
Quick Reference
| Task | Reference File |
|---|---|
| Build configuration | |
| Archives (tar.gz, zip) | |
| Docker images | |
| Linux packages (deb/rpm) | |
| Homebrew/Scoop/AUR | |
| Signing & notarization | |
| Changelog generation | |
| CI/CD integration | |
| Template variables | |
| Complete examples | |
Essential Commands
# Initialize new config goreleaser init # Validate configuration goreleaser check # Test build locally (no publish) goreleaser release --snapshot --clean # Create release (usually run in CI) goreleaser release
Configuration File
GoReleaser uses
.goreleaser.yaml (or .goreleaser.yml). Enable schema validation:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json version: 2 # Project name (defaults to directory name) project_name: myapp
Minimal Go Configuration
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json version: 2 builds: - main: ./cmd/myapp binary: myapp goos: [linux, darwin, windows] goarch: [amd64, arm64] ldflags: - -s -w - -X main.version={{.Version}} archives: - formats: [tar.gz] format_overrides: - goos: windows formats: [zip] changelog: sort: asc filters: exclude: - "^docs:" - "^test:"
Build Targets
Go (default)
builds: - builder: go # optional, default main: ./cmd/app goos: [linux, darwin, windows] goarch: [amd64, arm64] goarm: ["6", "7"] # for ARM builds
Rust
builds: - builder: rust targets: - x86_64-unknown-linux-gnu - x86_64-apple-darwin - aarch64-apple-darwin
Zig
builds: - builder: zig targets: - x86_64-linux-gnu - x86_64-macos - aarch64-macos
Prebuilt Binaries
builds: - builder: prebuilt prebuilt: path: dist/myapp_{{ .Os }}_{{ .Arch }}/myapp{{ .Ext }}
Common Patterns
Version Injection (Go)
builds: - ldflags: - -X main.version={{.Version}} - -X main.commit={{.Commit}} - -X main.date={{.Date}}
CGO Disabled
builds: - env: - CGO_ENABLED=0
Multiple Binaries
builds: - id: cli main: ./cmd/cli binary: myapp - id: server main: ./cmd/server binary: myapp-server
Publishing
Homebrew Tap
brews: - repository: owner: myorg name: homebrew-tap homepage: https://example.com description: "My application"
Docker Images
dockers_v2: - dockerfile: Dockerfile images: - "ghcr.io/myorg/myapp:{{ .Tag }}" - "ghcr.io/myorg/myapp:latest"
GitHub Release
release: github: owner: myorg name: myrepo draft: false prerelease: auto
Environment Variables
| Variable | Purpose |
|---|---|
| GitHub API access |
| GitLab API access |
| Gitea API access |
| Pro license key |
Workflow
- Initialize:
createsgoreleaser init.goreleaser.yaml - Configure: Edit config for your needs (see reference files)
- Validate:
verifies configurationgoreleaser check - Test:
tests locallygoreleaser release --snapshot --clean - Release: Tag and push, CI runs
goreleaser release
When to Load References
- Setting up builds: Load
for complete build optionsreferences/builds.md - Configuring Docker: Load
for multi-arch imagesreferences/docker.md - Linux packages: Load
for deb/rpm/apk packagesreferences/nfpm.md - Package managers: Load
for Homebrew/Scoop/AUR/etc.references/homebrew.md - CI setup: Load
for GitHub Actions/GitLab CIreferences/ci.md - Template syntax: Load
for available variablesreferences/templates.md - Complete examples: Load
for copy-paste configsreferences/examples.md