Skip to content

chore: migrate Homebrew release flow from GoReleaser brews#104

Merged
satococoa merged 3 commits intomainfrom
codex/homebrew-release-migration
Mar 8, 2026
Merged

chore: migrate Homebrew release flow from GoReleaser brews#104
satococoa merged 3 commits intomainfrom
codex/homebrew-release-migration

Conversation

@satococoa
Copy link
Copy Markdown
Owner

@satococoa satococoa commented Mar 5, 2026

Summary

  • remove GoReleaser brews integration from .goreleaser.yml
  • add Homebrew formula template + render/sync scripts as source of truth in wtp
  • update release workflow to sync tap formula then run mislav/bump-homebrew-formula-action@v3 (stable tags only)
  • document the new Homebrew release flow in docs

Notes

  • this keeps the install command unchanged: brew install satococoa/tap/wtp
  • formula bootstrap change in homebrew-tap is handled in a separate PR

Copilot AI review requested due to automatic review settings March 5, 2026 17:57
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

Warning

Rate limit exceeded

@satococoa has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 37 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 09a9bb5d-6c16-48e4-9bc0-b6bfd3828b28

📥 Commits

Reviewing files that changed from the base of the PR and between 00d2945 and 974d74e.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • scripts/render-homebrew-formula.sh
  • scripts/sync-homebrew-formula.sh
📝 Walkthrough

Walkthrough

This pull request refactors the Homebrew release workflow by moving publication from GoReleaser to GitHub Actions. It introduces a template-based Homebrew formula, two automation scripts for rendering and syncing the formula to a tap repository, and corresponding GitHub Actions jobs that handle formula synchronization and version bumping on releases.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/release.yml
Removed HOMEBREW_TAP_GITHUB_TOKEN from release job; added sync-homebrew-formula job to render and push formula updates to tap; added bump-homebrew-formula job to bump version on stable releases.
GoReleaser Configuration
.goreleaser.yml
Removed entire brews section (~100 lines) containing Homebrew tap publishing configuration, repository details, shell completions, and test steps.
Homebrew Formula
packaging/homebrew/wtp.rb.tmpl
New Homebrew formula template defining the Wtp package with build/runtime dependencies, install routine building Go binary with ldflags, and lazy shell completion initialization for bash/zsh/fish.
Release Scripts
scripts/render-homebrew-formula.sh, scripts/sync-homebrew-formula.sh
New scripts: render-homebrew-formula.sh substitutes version/sha256 placeholders in formula template; sync-homebrew-formula.sh extracts version/sha256 from existing formula, re-renders template, and commits/pushes changes to tap repository with Git authentication.
Documentation
docs/homebrew-release.md
New documentation explaining the Homebrew release flow, including source of truth locations, release workflow steps, and instructions for updating install behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hopping through formulas with glee,
Templates render, synced so free,
Shell completions dance in the night,
Homebrew taps take flight!
With scripts that validate and test,
This release workflow's simply the best! 🍺✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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 change: migrating the Homebrew release flow from GoReleaser's brews integration to a custom workflow with template, render, and sync scripts.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/homebrew-release-migration

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/render-homebrew-formula.sh`:
- Around line 23-40: The argument parsing loop currently calls shift 2 for flags
(--version, --sha256, --template, --output) without verifying a following value,
which can cause a "shift count out of range" crash; update the while/case in the
parsing logic to check that "$2" (or $#) is present and non-empty before
performing shift 2 for each flag and, if missing, print a clear error
referencing the specific flag (e.g., mention
--version/--sha256/--template/--output) and exit with non‑zero status; ensure
you update the branches that set VERSION, SHA256, TEMPLATE_PATH, and OUTPUT_PATH
so they validate the argument exists before assigning and shifting.

In `@scripts/sync-homebrew-formula.sh`:
- Around line 23-24: The script currently clones the tap into ${tap_dir} and
later pushes HEAD:${TARGET_BRANCH} but never checks out or ensures a local
branch named TARGET_BRANCH exists; update the flow after cloning (around the git
clone -> push sequence) to explicitly fetch and switch to TARGET_BRANCH (e.g.,
run a git fetch origin ${TARGET_BRANCH} and git checkout -B ${TARGET_BRANCH}
--track origin/${TARGET_BRANCH} if it exists, or create the branch locally if
not) so that subsequent commits are made on the correct branch before running
git add/commit and git push HEAD:${TARGET_BRANCH}; reference the variables
TARGET_BRANCH and tap_dir when locating where to add the checkout logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ddbb26c9-d555-42d0-8bed-b5735552022d

📥 Commits

Reviewing files that changed from the base of the PR and between 44be22f and 00d2945.

📒 Files selected for processing (6)
  • .github/workflows/release.yml
  • .goreleaser.yml
  • docs/homebrew-release.md
  • packaging/homebrew/wtp.rb.tmpl
  • scripts/render-homebrew-formula.sh
  • scripts/sync-homebrew-formula.sh
💤 Files with no reviewable changes (1)
  • .goreleaser.yml

Comment thread scripts/render-homebrew-formula.sh
Comment thread scripts/sync-homebrew-formula.sh
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00d2945908

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/release.yml
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@satococoa satococoa merged commit 764e09e into main Mar 8, 2026
8 checks passed
@satococoa satococoa deleted the codex/homebrew-release-migration branch March 8, 2026 15:48
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