Skip to content

Add GoReleaser and pre-built binary distribution#16

Merged
ChrisJBurns merged 1 commit intomainfrom
pre-built-binary
Jan 15, 2026
Merged

Add GoReleaser and pre-built binary distribution#16
ChrisJBurns merged 1 commit intomainfrom
pre-built-binary

Conversation

@ChrisJBurns
Copy link
Collaborator

Summary

This PR improves action performance by using pre-built binaries instead of compiling Go code on every run.

Changes

File Description
.goreleaser.yml GoReleaser config for multi-platform binary builds (linux/darwin × amd64/arm64)
.github/workflows/release.yml Workflow that triggers on v* tags to build and publish releases
action.yml Updated to download pre-built binaries instead of go run
.gitignore Added dist/ directory

Performance Improvement

Metric Before After
Startup time ~30 seconds ~2 seconds
Method Compile on every run Download pre-built binary

How It Works

  1. When you push a tag like v1.2.0, the release workflow runs
  2. GoReleaser builds binaries for all platforms and creates a GitHub release
  3. When users reference @v1.2.0, the action downloads the matching binary

Version Validation

The action now validates that it's referenced with a proper version tag:

# ✅ Valid
uses: stacklok/releaseo@v1.2.0

# ❌ Invalid - will error
uses: stacklok/releaseo@main
uses: stacklok/releaseo@some-branch

Error messages guide users to the correct usage:

::error::Invalid version 'main'. Please use a semantic version tag (e.g., @v1.0.0). Using @main or @branch-name is not supported.

Breaking Change

⚠️ Users must reference this action with a version tag (e.g., @v1.0.0)

Using @main or branch names is no longer supported. This ensures reproducible builds and better security.

Test plan

  • GoReleaser config syntax is valid
  • Build and tests pass
  • Create a test release tag to verify the full flow (post-merge)

🤖 Generated with Claude Code

This change improves action performance by using pre-built binaries instead
of compiling on every run.

**Changes:**

- Add `.goreleaser.yml` configuration for multi-platform binary builds
  - Builds for linux/darwin on amd64/arm64
  - Creates GitHub releases with checksums

- Add `.github/workflows/release.yml` workflow
  - Triggers on version tags (v*)
  - Runs tests before release
  - Uses GoReleaser to build and publish binaries

- Update `action.yml` to download pre-built binaries
  - Downloads binary matching the action's version tag
  - Auto-detects OS and architecture
  - Validates version tag format (requires @vX.Y.Z)
  - Clear error messages for invalid usage

- Update `.gitignore` to exclude GoReleaser dist/ directory

**Performance improvement:**
- Before: ~30 seconds (compile on every run)
- After: ~2 seconds (download pre-built binary)

**Breaking change:**
- Action must now be referenced with a version tag (e.g., @v1.0.0)
- Using @main or branch names is no longer supported

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisJBurns ChrisJBurns merged commit 32bfc79 into main Jan 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant