Skip to content

goreleaser integration

This document describes how GoReleaser is integrated into the PromptKit release process to automate binary builds and GitHub releases.

GoReleaser automates the creation of:

  • Multi-platform binaries (Linux, macOS, Windows for amd64 and arm64)
  • Archives (tar.gz for Unix, zip for Windows)
  • Checksums (SHA256 for verification)
  • GitHub Releases (with changelog and artifacts)
Terminal window
# macOS (Homebrew)
brew install goreleaser/tap/goreleaser
# Linux (snap)
snap install --classic goreleaser
# Go install
go install github.com/goreleaser/goreleaser@latest
# Verify
goreleaser --version

GoReleaser is configured in .goreleaser.yml at the repository root. Key features:

  • Builds both tools: promptarena and packc
  • Cross-platform: Linux, macOS, Windows (amd64, arm64)
  • Version injection: Embeds version, commit, and date into binaries
  • Draft releases: Creates drafts for review before publishing
  • Automated changelog: Groups commits by type (features, fixes, etc.)

The scripts/release.sh script includes GoReleaser:

Terminal window
# Run the full release
./scripts/release.sh v1.0.0
# GoReleaser runs after:
# 1. Libraries are tagged
# 2. Tools are updated and tagged
# 3. All modules are available on Go proxy

What happens:

  • Script asks if you want to run GoReleaser
  • Checks if goreleaser is installed
  • Runs goreleaser release --clean
  • Creates draft GitHub release with binaries

The .github/workflows/release.yml workflow uses GoReleaser:

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

What happens:

  • Automatically runs after tools are tagged
  • Builds binaries in GitHub Actions runners
  • Uploads artifacts to GitHub Release
  • No local setup needed
PlatformArchitectureOutput
Linuxamd64promptarena, packc
Linuxarm64promptarena, packc
macOSamd64promptarena, packc
macOSarm64promptarena, packc
Windowsamd64promptarena.exe, packc.exe
Windowsarm64promptarena.exe, packc.exe

Archives are named: PromptKit_{version}_{OS}_{arch}.{tar.gz|zip}

Examples:

  • PromptKit_v1.0.0_Linux_x86_64.tar.gz
  • PromptKit_v1.0.0_Darwin_arm64.tar.gz
  • PromptKit_v1.0.0_Windows_x86_64.zip

Each archive contains:

  • Binary files (promptarena, packc)
  • README.md
  • LICENSE
  • CHANGELOG.md

checksums.txt contains SHA256 hashes for all archives:

abc123... PromptKit_v1.0.0_Linux_x86_64.tar.gz
def456... PromptKit_v1.0.0_Darwin_arm64.tar.gz
...

Users can verify downloads:

Terminal window
shasum -a 256 -c checksums.txt
graph TD
A[Tag Libraries] -->|runtime, pkg, sdk| B[Wait for Go Proxy]
B --> C[Update Tools]
C --> D[Tag Tools]
D --> E[Run GoReleaser]
E --> F[Build Binaries]
F --> G[Generate Changelog]
G --> H[Create Draft Release]
H --> I[Upload Artifacts]
I --> J[Review & Publish]
  1. Tag libraries and tools (done by release script/workflow)

    Terminal window
    git tag runtime/v1.0.0
    git tag pkg/v1.0.0
    git tag sdk/v1.0.0
    git tag tools/arena/v1.0.0
    git tag tools/packc/v1.0.0
  2. GoReleaser runs automatically

    • Detects latest tag
    • Builds for all platforms
    • Generates changelog from commits
  3. Draft release created

Terminal window
# Download from GitHub release
wget https://github.com/AltairaLabs/PromptKit/releases/download/v1.0.0/PromptKit_v1.0.0_Linux_x86_64.tar.gz
# Extract
tar -xzf PromptKit_v1.0.0_Linux_x86_64.tar.gz
# Verify
shasum -a 256 -c checksums.txt
# Install
sudo mv promptarena /usr/local/bin/
sudo mv packc /usr/local/bin/
Terminal window
# Arena
go install github.com/AltairaLabs/PromptKit/tools/arena/cmd/promptarena@v1.0.0
# PackC
go install github.com/AltairaLabs/PromptKit/tools/packc@v1.0.0
Terminal window
go get github.com/AltairaLabs/PromptKit/sdk@v1.0.0
Terminal window
# Build locally without releasing
goreleaser build --snapshot --clean
# Check output in dist/
ls -lh dist/
Terminal window
# Simulate release process
goreleaser release --snapshot --clean
# Creates everything in dist/ but doesn't:
# - Push to GitHub
# - Create actual release
# - Upload artifacts
Terminal window
# Create a test tag
git tag test/v0.0.1-goreleaser
git push origin test/v0.0.1-goreleaser
# Run goreleaser
GITHUB_TOKEN=your_token goreleaser release --clean
# Clean up test release manually on GitHub

Edit .goreleaser.yml:

builds:
- id: promptarena
# ... existing config ...
goos:
- linux
- darwin
- windows
- freebsd # Add this
archives:
- format: tar.gz
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: dmg # Create DMG for macOS

Uncomment in .goreleaser.yml:

brews:
- name: promptkit
repository:
owner: AltairaLabs
name: homebrew-tap
# ... rest of config

Then users can:

Terminal window
brew tap AltairaLabs/tap
brew install promptkit

Uncomment in .goreleaser.yml:

dockers:
- image_templates:
- "ghcr.io/altairalabs/promptarena:{{ .Version }}"
- "ghcr.io/altairalabs/promptarena:latest"
Terminal window
# Install it
brew install goreleaser/tap/goreleaser
# Or skip it (releases can be created manually)
gh release create v1.0.0 --draft

Check build logs:

Terminal window
goreleaser build --snapshot --clean

Common issues:

  • CGO disabled but code uses C
  • Platform-specific code without build tags
  • Missing dependencies

Ensure GITHUB_TOKEN has permissions:

  • contents: write (for releases)
  • packages: write (if using Docker)

Delete and retry:

Terminal window
gh release delete v1.0.0 --yes
git push origin --delete v1.0.0
goreleaser release --clean

GoReleaser creates drafts by default - review before publishing:

  • Check changelog accuracy
  • Verify binary integrity
  • Test a few downloads
Terminal window
# Good
v1.0.0, v1.1.0, v2.0.0-beta.1
# Bad
release-2024, latest, v1

When adding new tools or changing structure:

  • Update build configurations
  • Test with --snapshot first
  • Document changes

GoReleaser uses the latest tag. For monorepo:

Terminal window
# Tag the VERSION, not individual components
git tag v1.0.0 # This triggers GoReleaser

Last Updated: 2 November 2025