Agent Skills
› NeverSight/learn-skills.dev
› goreleaser
goreleaser
GitHub自动化软件发布流程,支持构建跨平台二进制、打包、生成Docker镜像及发布至包管理器。适用于配置.goreleaser.yaml、设置CI/CD流水线及自动化发行版分发。
Trigger Scenarios
创建或编辑 .goreleaser.yaml 文件
设置发布流水线
构建跨平台二进制
发布到 Homebrew/Scoop/AUR
创建 Docker 镜像
自动化生成 Changelog
询问关于软件发布或 GitHub Release 的问题
Install
npx skills add NeverSight/learn-skills.dev --skill goreleaser -g -y
SKILL.md
Frontmatter
{
"name": "goreleaser",
"version": "1.0.0",
"description": "Configure and use GoReleaser for release automation. Use this skill when creating or editing .goreleaser.yaml files, setting up release pipelines, building cross-platform binaries, publishing to package managers (Homebrew, Scoop, AUR, nFPM packages), creating Docker images, or automating changelog generation. Supports Go, Rust, Zig, TypeScript (Bun\/Deno), and Python (PyInstaller\/UV\/Poetry) projects. Also use when asked about releasing software, creating GitHub releases, or automating binary distribution.\n"
}
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 | references/builds.md |
| Archives (tar.gz, zip) | references/archives.md |
| Docker images | references/docker.md |
| Linux packages (deb/rpm) | references/nfpm.md |
| Homebrew/Scoop/AUR | references/homebrew.md |
| Signing & notarization | references/signing.md |
| Changelog generation | references/changelog.md |
| CI/CD integration | references/ci.md |
| Template variables | references/templates.md |
| Complete examples | references/examples.md |
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_TOKEN |
GitHub API access |
GITLAB_TOKEN |
GitLab API access |
GITEA_TOKEN |
Gitea API access |
GORELEASER_KEY |
Pro license key |
Workflow
- Initialize:
goreleaser initcreates.goreleaser.yaml - Configure: Edit config for your needs (see reference files)
- Validate:
goreleaser checkverifies configuration - Test:
goreleaser release --snapshot --cleantests locally - Release: Tag and push, CI runs
goreleaser release
When to Load References
- Setting up builds: Load
references/builds.mdfor complete build options - Configuring Docker: Load
references/docker.mdfor multi-arch images - Linux packages: Load
references/nfpm.mdfor deb/rpm/apk packages - Package managers: Load
references/homebrew.mdfor Homebrew/Scoop/AUR/etc. - CI setup: Load
references/ci.mdfor GitHub Actions/GitLab CI - Template syntax: Load
references/templates.mdfor available variables - Complete examples: Load
references/examples.mdfor copy-paste configs
Version History
- e0220ca Current 2026-07-05 22:10


