Skip to content

ci: add goreleaser config and release workflow#50

Merged
shreemaan-abhishek merged 2 commits into
mainfrom
feat/release-goreleaser
May 27, 2026
Merged

ci: add goreleaser config and release workflow#50
shreemaan-abhishek merged 2 commits into
mainfrom
feat/release-goreleaser

Conversation

@shreemaan-abhishek

@shreemaan-abhishek shreemaan-abhishek commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Port .goreleaser.yml from a7 (project name a6, module github.com/api7/a6); upgrade to goreleaser v2 syntax (version: 2, formats: [...]).
  • Add .github/workflows/release.yml that runs goreleaser on tag push (v*), producing tar.gz/zip archives for linux/darwin/windows on amd64/arm64 plus a checksums.txt.
  • Asset naming a6_<version>_<os>_<arch>.<ext> matches what internal/update.FindAsset looks for, so a6 update will discover assets from this workflow once a tag is published.

Locally validated with goreleaser check and goreleaser release --snapshot --clean; verified the produced binary reports the linker-injected version.

Closes part of #37 (config + workflow). Tagging v0.1.0-rc1 and the end-to-end a6 update verification will be done after this PR merges, so the workflow fires from main.

Refs #33, #37

Test plan

  • CI green on this PR
  • After merge, push tag v0.1.0-rc1 and confirm the Release workflow uploads 6 archives + checksums.txt
  • Run a dev build of a6 update against the published release and confirm it finds the asset, downloads, and self-replaces

Summary by CodeRabbit

  • Chores
    • Added an automated release pipeline that runs on version tag pushes.
    • Builds and publishes binaries for Linux, macOS, and Windows on x86-64 and ARM64.
    • Generates checksums and archives (tar.gz / zip) and produces curated changelogs.
    • Publishes releases to GitHub (non-draft, prerelease auto), and embeds version/commit/date into built binaries.

Review Change Stack

Wires goreleaser v2 to produce multi-arch binaries (linux, darwin,
windows for amd64 and arm64) with sha256 checksums on tag push.
Asset naming `a6_<version>_<os>_<arch>.<ext>` matches the format
expected by the `a6 update` command's FindAsset.

Refs #37
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c6108991-b6cb-4a63-b5ba-deb483d1db7e

📥 Commits

Reviewing files that changed from the base of the PR and between a7bc3f8 and 74c8388.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

Adds a GitHub Actions Release workflow and a .goreleaser.yml. On tags v* it builds ./cmd/a6 for linux/darwin/windows (amd64, arm64), packages archives (tar.gz/zip), writes checksums, generates a filtered changelog, and publishes a GitHub release.

Changes

Release Automation

Layer / File(s) Summary
Release workflow trigger and job orchestration
.github/workflows/release.yml
Workflow triggers on pushed tags v*, grants contents: write, checks out the repo, sets up Go from go.mod, and runs goreleaser/goreleaser-action with release --clean, passing GITHUB_TOKEN.
GoReleaser build and release configuration
.goreleaser.yml
Defines project name, pre-build go mod tidy, builds ./cmd/a6 with ldflags injecting Version/Commit/Date, targets linux/darwin/windows on amd64/arm64, produces tar.gz/zip archives, writes checksums.txt, filters changelog, and configures GitHub release for api7/a6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding a GoReleaser configuration file and a GitHub Actions release workflow for automated releases.
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.
E2e Test Quality Review ✅ Passed The PR adds only CI/CD configuration files (.github/workflows/release.yml and .goreleaser.yml) with no test code. The E2E Test Quality Review check is not applicable to configuration-only PRs.
Security Check ✅ Passed No security vulnerabilities: GITHUB_TOKEN from secrets (auto-masked), actions pinned to commit SHAs, persist-credentials false, minimal permissions, no hardcoded secrets or sensitive data exposure.

✏️ 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 feat/release-goreleaser

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 16-24: The workflow uses floating action tags and leaves checkout
credentials persisted, increasing risk; update the release workflow to pin
actions to specific SHAs or full version tags and disable credential persistence
when calling actions/checkout (set persist-credentials: false) and reduce
repository permissions by setting permissions.contents to read (or none) instead
of write; locate the uses of actions/checkout@v4, actions/setup-go@v5, and
goreleaser/goreleaser-action@v6 in the file and replace them with pinned
references and add persist-credentials: false under actions/checkout, and adjust
the top-level permissions block to remove or lower contents write access.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1fce8335-e02c-4457-9bcf-c628accb0d48

📥 Commits

Reviewing files that changed from the base of the PR and between efb26dd and a7bc3f8.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • .goreleaser.yml

Comment thread .github/workflows/release.yml Outdated
Pin actions/checkout, actions/setup-go, and goreleaser/goreleaser-action
to the commit SHAs for their v4/v5/v6 tags, and set
persist-credentials: false on checkout. Keeps the top-level
contents: write permission since goreleaser needs it to publish the
GitHub Release.

Addresses CodeRabbit review on #50.
@shreemaan-abhishek

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Pushed 74c8388:

  • Pinned actions/checkout@v4, actions/setup-go@v5, and goreleaser/goreleaser-action@v6 to commit SHAs (with the major-version tag in a trailing comment).
  • Added persist-credentials: false to the checkout step; goreleaser auths via GITHUB_TOKEN env, so the persisted git credential isn't needed.

Kept the top-level permissions: contents: write since the only job in this workflow is goreleaser, which needs write access to create the GitHub Release. Splitting it to job-level would be no-op given there is one job.

@shreemaan-abhishek shreemaan-abhishek merged commit 9b2745c into main May 27, 2026
6 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