Skip to content

Add homebrew private tap publishing target#59

Merged
silv-io merged 1 commit intomainfrom
silv-io/flc-409
Mar 3, 2026
Merged

Add homebrew private tap publishing target#59
silv-io merged 1 commit intomainfrom
silv-io/flc-409

Conversation

@silv-io
Copy link
Member

@silv-io silv-io commented Mar 2, 2026

Adds automatic Homebrew cask publishing to localstack/homebrew-tap via GoReleaser. This is the first step toward Homebrew distribution. Once this works, we can submit to homebrew-core for brew install lstk without the tap.

Changes

  • Add homebrew_casks config to .goreleaser.yaml
  • Generate shell completions (bash/zsh/fish) and include them in archives
  • Add quarantine removal hook for unsigned macOS binaries
  • Pass HOMEBREW_TAP_TOKEN to release job

After merge

  1. Tag a release to trigger the first cask publish
  2. Verify the cask appears in localstack/homebrew-tap/Casks/lstk.rb
  3. Test: brew tap localstack/tap && brew install --cask lstk

Validation

  • goreleaser check passes
  • Config mirrors goreleaser's own setup
  • PRO_ACCESS_TOKEN already has write access to homebrew-tap (used by localstack-cli)

@silv-io silv-io marked this pull request as ready for review March 2, 2026 17:37
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

The changes configure the release pipeline to generate shell completion scripts during the build process, package them with the application archives, and distribute the application via Homebrew casks with macOS-specific post-installation handling. A Homebrew token is added to the CI workflow for authentication.

Changes

Cohort / File(s) Summary
CI/CD Environment
.github/workflows/ci.yml
Adds HOMEBREW_TAP_TOKEN environment variable to the release job, set from secrets for Goreleaser authentication.
Release Configuration
.goreleaser.yaml
Adds before hooks to run go mod tidy and generate bash/zsh/fish completion scripts; extends archives to include completions/* files; introduces new homebrew_casks section for lstk package with repository, homepage, description, license, completions mapping, and macOS post-install hook to remove quarantine attribute.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add homebrew private tap publishing target' accurately and clearly describes the main change—adding Homebrew cask publishing functionality via GoReleaser.
Description check ✅ Passed The description is directly related to the changeset, detailing the Homebrew publishing configuration, completion scripts, macOS binary hook, and token setup that match the file changes.

✏️ 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 silv-io/flc-409

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

@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.

🧹 Nitpick comments (2)
.goreleaser.yaml (1)

7-11: Keep release hooks read-only; remove go mod tidy from publish path.

At Line 7, go mod tidy can mutate module files during release, which makes artifacts less reproducible from the tag. Prefer enforcing tidy in lint/CI, not in publish hooks.

Proposed change
 before:
   hooks:
-    - go mod tidy
     - mkdir -p completions
     - sh -c "go run . completion bash > completions/lstk.bash"
     - sh -c "go run . completion zsh > completions/lstk.zsh"
     - sh -c "go run . completion fish > completions/lstk.fish"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.goreleaser.yaml around lines 7 - 11, Remove the mutating "go mod tidy"
command from the publish hooks in .goreleaser.yaml so release hooks remain
read-only; locate the entry containing the line 'go mod tidy' in the
publish/hooks (the commands that include 'sh -c "go run . completion ..."' and
delete that single 'go mod tidy' command, keeping the completion generation
steps intact, and instead ensure tidiness is enforced in CI/lint pipelines
rather than in the publish hook.
.github/workflows/ci.yml (1)

160-160: Use a dedicated tap token secret instead of PRO_ACCESS_TOKEN.

At Line 160, consider switching to a purpose-scoped secret (least privilege) for Homebrew tap publishing.

Proposed change
-          HOMEBREW_TAP_TOKEN: ${{ secrets.PRO_ACCESS_TOKEN }}
+          HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 160, Replace the broad PRO_ACCESS_TOKEN
secret with a purpose-scoped Homebrew tap secret: change the environment entry
HOMEBREW_TAP_TOKEN: ${{ secrets.PRO_ACCESS_TOKEN }} to HOMEBREW_TAP_TOKEN: ${{
secrets.HOMEBREW_TAP_TOKEN }} and create the new repository secret named
HOMEBREW_TAP_TOKEN in the repo/organization secrets (or update actions secrets)
with the minimum-scoped token used for Homebrew tap publishing; ensure any
workflows or docs referencing PRO_ACCESS_TOKEN for tap publishing are updated to
reference HOMEBREW_TAP_TOKEN instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 160: Replace the broad PRO_ACCESS_TOKEN secret with a purpose-scoped
Homebrew tap secret: change the environment entry HOMEBREW_TAP_TOKEN: ${{
secrets.PRO_ACCESS_TOKEN }} to HOMEBREW_TAP_TOKEN: ${{
secrets.HOMEBREW_TAP_TOKEN }} and create the new repository secret named
HOMEBREW_TAP_TOKEN in the repo/organization secrets (or update actions secrets)
with the minimum-scoped token used for Homebrew tap publishing; ensure any
workflows or docs referencing PRO_ACCESS_TOKEN for tap publishing are updated to
reference HOMEBREW_TAP_TOKEN instead.

In @.goreleaser.yaml:
- Around line 7-11: Remove the mutating "go mod tidy" command from the publish
hooks in .goreleaser.yaml so release hooks remain read-only; locate the entry
containing the line 'go mod tidy' in the publish/hooks (the commands that
include 'sh -c "go run . completion ..."' and delete that single 'go mod tidy'
command, keeping the completion generation steps intact, and instead ensure
tidiness is enforced in CI/lint pipelines rather than in the publish hook.

ℹ️ Review info

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1742c15 and 670562d.

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

@silv-io silv-io merged commit a84a8c7 into main Mar 3, 2026
8 checks passed
@silv-io silv-io deleted the silv-io/flc-409 branch March 3, 2026 09:05
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