Claude-skill-registry goreleaser
Initialize or update GoReleaser configuration for automated Go releases with multi-architecture Docker builds, binary distribution, and Homebrew publishing
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/goreleaser" ~/.claude/skills/majiayu000-claude-skill-registry-goreleaser && rm -rf "$T"
skills/data/goreleaser/SKILL.mdGoReleaser Setup Skill
Automate Go project releases with cross-platform binaries, multi-architecture Docker images, and package distribution.
Overview
GoReleaser handles complete release automation for Go projects:
- Building binaries for multiple OS/architectures
- Creating multi-architecture Docker images and manifests
- Publishing to GitHub/GitLab releases
- Generating Homebrew formulas
- Creating automated changelogs
- Calculating checksums and signatures
This skill provides templates and guidance for professional release automation.
Prerequisites
- GoReleaser installed:
or see https://goreleaser.com/install/brew install goreleaser - Docker with buildx: For multi-architecture builds (
)docker buildx version - Git tags: GoReleaser works with semantic versioning tags (e.g.,
)v1.0.0 - GitHub/GitLab token: For release creation and Homebrew tap updates
- Project structure: Go module with
directory (or adjustcmd/
field)dir
Quick Start
Step 1: Analyze Project Structure
Understand your project:
# Check for existing configuration ls -la .goreleaser.yml .goreleaser.yaml # Identify build entry point find . -name "main.go" -type f # Verify Go module cat go.mod
Step 2: Copy Template Files
Copy templates from
assets/ directory:
# Copy GoReleaser config cp assets/.goreleaser.yml . # Copy Dockerfile cp assets/Dockerfile . # Copy resources (for Docker) mkdir -p resources/etc cp assets/resources/etc/passwd resources/etc/
Step 3: Customize Configuration
Update
.goreleaser.yml with project-specific values:
- Project name: Replace
with actual namePROJECT_NAME - Build configuration:
- Set
if main.go is not indircmd/ - Adjust
for version injectionldflags - Configure target OS/architectures
- Set
- Docker registry: Update image templates
- GitHub:
ghcr.io/OWNER/PROJECT - GitLab:
registry.gitlab.com/OWNER/PROJECT - Docker Hub:
docker.io/OWNER/PROJECT
- GitHub:
- Homebrew tap (optional): Configure repository and token
Step 4: Update Dockerfile
Customize the Dockerfile:
- Replace
with actual binary namePROJECT_BINARY - Adjust user name in both Dockerfile and
resources/etc/passwd - Add any additional runtime dependencies
Step 5: Set Up CI/CD Integration
Add environment variables to CI/CD:
# GitHub Actions GITHUB_TOKEN # Automatic in GitHub Actions HOMEBREW_TAP_TOKEN # If publishing to Homebrew # GitLab CI GITLAB_TOKEN # Automatic in GitLab CI HOMEBREW_TAP_TOKEN # If publishing to Homebrew
Step 6: Test Configuration
Validate before tagging:
# Check configuration goreleaser check # Create snapshot build (no release) goreleaser build --snapshot --clean # Test full release process goreleaser release --snapshot --clean --skip=publish
Step 7: Create Release
When ready:
# Create and push tag git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0 # Run GoReleaser (usually in CI/CD) goreleaser release --clean
Template Files & Patterns
Templates in
assets/ directory:
- Complete config with multi-arch Docker, Homebrew, archives.goreleaser.yml
- Optimized multi-stage Docker buildDockerfile
- Non-root container user configresources/etc/passwd
For simpler patterns (binary-only, Docker-only, private registries), see REFERENCE.md.
Task Runner Integration
Integrate with Taskfile.yml:
version: '3' tasks: release:check: desc: Validate GoReleaser config cmds: - goreleaser check release:snapshot: desc: Test release build cmds: - goreleaser release --snapshot --clean --skip=publish release: desc: Create production release cmds: - goreleaser release --clean
Expected Output
After using this skill, the project will have:
- ✓
configured for the project.goreleaser.yml - ✓
for multi-architecture buildsDockerfile - ✓
for non-root container userresources/etc/passwd - ✓ CI/CD pipeline ready for automated releases
- ✓ Tested snapshot builds
Users can then create releases by simply pushing Git tags.
Additional Documentation
- Configuration patterns and examples: See REFERENCE.md
- Troubleshooting common issues: See TROUBLESHOOTING.md
- Template files: Available in
directoryassets/
Best Practices
- Semantic Versioning: Use
format for tagsv1.2.3 - Conventional Commits: Enables automatic changelog generation
- Test Snapshots: Always test with
before tagging--snapshot - Multi-arch Testing: Verify builds work on target architectures
- Secret Management: Never commit tokens, use CI/CD secrets
Resources
- Official docs: https://goreleaser.com
- Example configs: https://github.com/goreleaser/goreleaser/tree/main/.github/workflows
- Docker buildx: https://docs.docker.com/buildx/working-with-buildx/
- Conventional commits: https://www.conventionalcommits.org/