Skip to content

ci(release): add goreleaser release workflow#12

Merged
flc1125 merged 2 commits into
mainfrom
release/goreleaser
May 19, 2026
Merged

ci(release): add goreleaser release workflow#12
flc1125 merged 2 commits into
mainfrom
release/goreleaser

Conversation

@flc1125
Copy link
Copy Markdown
Member

@flc1125 flc1125 commented May 19, 2026

Summary

Add GoReleaser-based release automation so tag pushes can build and attach cross-platform tapd binaries to GitHub Releases.

Changes

  • Add GoReleaser configuration for darwin, linux, and windows archives with checksums
  • Add a tag-triggered GitHub Actions release workflow using GoReleaser
  • Add Makefile targets for release config checks, snapshot builds, and guarded publishing
  • Ignore the local GoReleaser dist/ output directory

Motivation

  • GitHub Releases should include ready-to-download CLI binaries instead of requiring users to build from source
  • Local publishing should require explicit tag confirmation to reduce accidental release risk

Testing

  • make release-check
  • go test ./...

Summary by CodeRabbit

Release Notes

  • Chores
    • Configured automated release pipeline to generate and distribute pre-built binaries for macOS, Linux, and Windows across Intel and ARM architectures.
    • Integrated validation and testing checks into the release workflow.
    • Release packages now include checksums for integrity verification.

Review Change Stack

Copilot AI review requested due to automatic review settings May 19, 2026 14:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds GoReleaser-based automation to publish tapd cross-platform binaries to GitHub Releases on tag pushes, and provides local Makefile helpers for checking/building/publishing releases more safely.

Changes:

  • Introduces a GoReleaser configuration to build archives for darwin/linux/windows (amd64/arm64) and publish checksums.
  • Adds a tag-triggered GitHub Actions workflow to run tests and publish release artifacts via GoReleaser.
  • Adds Makefile targets for GoReleaser config validation, snapshot builds, and a tag/confirmation-gated publish flow; ignores dist/.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
Makefile Adds GoReleaser-driven release targets (check, snapshot, publish) with an explicit confirmation gate.
.goreleaser.yaml Defines build matrix, archive naming, checksums, snapshot versioning, and changelog filtering for releases.
.gitignore Ignores GoReleaser dist/ output and normalizes the .cache entry.
.github/workflows/release.yml Adds a tag-based CI release pipeline using goreleaser-action to publish GitHub Release assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
@@ -1,5 +1,6 @@
GO = go
GOLANGCI_LINT = $(GO) tool golangci-lint
GORELEASER = $(GO) run github.com/goreleaser/goreleaser/v2@latest
Comment thread .goreleaser.yaml
Comment on lines +5 to +8
before:
hooks:
- go mod tidy -compat=1.25.0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
Comment on lines +35 to +43
- name: Run tests
run: make test

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds a complete release automation pipeline for the tapd CLI project. It introduces GoReleaser v2 configuration, Makefile release targets for local validation and building, and a GitHub Actions workflow that automatically publishes releases when version tags are pushed.

Changes

Release Pipeline Infrastructure

Layer / File(s) Summary
GoReleaser Configuration Foundation
.goreleaser.yaml, Makefile, .gitignore
Defines GoReleaser v2 configuration to build tapd binaries for darwin, linux, and windows on amd64 and arm64, with archive naming, checksums, snapshot versioning, and changelog filtering. Adds GORELEASER variable and ignores the dist/ build output directory.
Local Release Build Targets
Makefile
Introduces release-check (validates config), release-snapshot (builds snapshots), confirm-release (verifies tag and requires confirmation), and release (orchestrates full release with tests and clean state checks).
GitHub Actions CI/CD Release Trigger
.github/workflows/release.yml
New workflow triggered on v* tag pushes that sets up Go 1.26.x, caches artifacts, runs tests, and invokes GoReleaser to publish the release.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A release pipeline springs forth with glee,
With GoReleaser building cross-platform and free,
Tags trigger GitHub's automated dance,
While Makefile targets guard each advance,
Version by version, the tapd CLI takes flight! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci(release): add goreleaser release workflow' directly describes the main change: adding a GoReleaser-based release workflow to CI. It's specific, clear, and accurately reflects the primary purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/goreleaser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@flc1125 flc1125 merged commit 2f682d6 into main May 19, 2026
6 of 7 checks passed
@flc1125 flc1125 deleted the release/goreleaser branch May 19, 2026 14:08
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces release automation by integrating GoReleaser. Key changes include the addition of a ".goreleaser.yaml" configuration file, the exclusion of the "dist/" directory in ".gitignore", and new "Makefile" targets for managing release builds and safety checks. Feedback suggests optimizing the build process by using "go tool" for GoReleaser version management (leveraging Go 1.24+ features), adding "ldflags" to minimize binary size and inject versioning metadata, and adhering to Go conventions by using lowercase operating system names in archive filenames.

Comment thread Makefile
@@ -1,5 +1,6 @@
GO = go
GOLANGCI_LINT = $(GO) tool golangci-lint
GORELEASER = $(GO) run github.com/goreleaser/goreleaser/v2@latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the GOLANGCI_LINT definition and to leverage Go 1.24+ tool management, it is recommended to use $(GO) tool goreleaser. This ensures the tool version is pinned in go.mod and avoids downloading it on every execution. You will need to run go get -tool github.com/goreleaser/goreleaser/v2 once to update your go.mod file.

GORELEASER = $(GO) tool goreleaser

Comment thread .goreleaser.yaml
Comment on lines +13 to +14
env:
- CGO_ENABLED=0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is highly recommended to add ldflags to strip debug information (-s -w) to reduce the final binary size. Additionally, you should consider injecting versioning metadata (version, commit, date) so the CLI can report its version accurately. Note that you will need to define corresponding variables in your main package or a dedicated version package to receive these values.

    env:
      - CGO_ENABLED=0
    ldflags:
      - -s -w
      - -X main.version={{.Version}}
      - -X main.commit={{.Commit}}
      - -X main.date={{.Date}}

Comment thread .goreleaser.yaml
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- title .Os }}_
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using title .Os will result in capitalized operating system names in the archive filenames (e.g., Linux, Darwin, Windows). It is more conventional in the Go ecosystem to keep these names lowercase to match the standard GOOS values.

      {{- .Os }}_

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.

2 participants