Skip to content

feat: ship rulesync via a self-contained Homebrew tap#2221

Merged
dyoshikawa merged 2 commits into
mainfrom
feat/homebrew-tap
Jul 12, 2026
Merged

feat: ship rulesync via a self-contained Homebrew tap#2221
dyoshikawa merged 2 commits into
mainfrom
feat/homebrew-tap

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Ships rulesync via a self-contained Homebrew tap inside this repository (no separate homebrew-* repo), so users can install the prebuilt binary from our own tap with same-minute availability and full control over the formula.

Resolves #2218.

Design decisions (from the issue's open questions)

  • Binary formulaFormula/rulesync.rb downloads the per-platform release asset (rulesync-{darwin,linux}-{arm64,x64}) that publish-assets.yml already builds, so it needs no node runtime and installs instantly.
  • Tap-only — the homebrew-core bump job in publish.yml is removed; the tap is now the maintained Homebrew path.
  • Auto-merge PR — on each release the homebrew job regenerates the formula from the release SHA256SUMS and opens an auto-merge PR against main, respecting branch protection.

Changes

  • Formula/rulesync.rb — binary formula (initialized with the real v9.6.3 checksums).
  • scripts/generate-homebrew-formula.ts (+ tests) — renders the formula from a version and the release SHA256SUMS; validates the version and fails when any platform checksum is missing.
  • .github/workflows/publish.yml — replaces the homebrew-core brew bump-formula-pr job with a job that downloads the release checksums, regenerates the formula, and opens an auto-merge PR.
  • README.md / docs/getting-started/installation.md (+ synced skills/rulesync/) — document the two-argument brew tap <name> <url> + brew install flow.

Install flow

brew tap dyoshikawa/rulesync https://github.com/dyoshikawa/rulesync
brew install rulesync
rulesync --version

Notes / caveats

  • The homebrew job's checkout and PR use secrets.HOMEBREW_FORMULA_TOKEN when present, falling back to GITHUB_TOKEN. Because a branch-protected main will not let a GITHUB_TOKEN-authored PR trigger required checks (and therefore auto-merge), a maintainer PAT is recommended; without it the formula PR is left open for a manual merge (the job logs a warning rather than failing).
  • The release workflow path only runs on release/v* PR merges, so it is not exercised by this PR's CI — only YAML/lint validity is checked here.
  • Homebrew has no Windows support; npm and the single-binary download remain the Windows paths.

🤖 Generated with Claude Code

Add an in-repo Homebrew tap so users can install the prebuilt binary from
our own tap with same-minute availability, instead of relying solely on the
homebrew-core formula bump.

- Add Formula/rulesync.rb, a binary formula that downloads the per-platform
  release asset (macOS/Linux, arm64/x64) with no node runtime dependency.
- Add scripts/generate-homebrew-formula.ts (with tests) to render the formula
  from a version and the release SHA256SUMS.
- Replace the homebrew-core bump job in publish.yml with a job that regenerates
  the formula on release and opens an auto-merge PR to update it on main.
- Document the two-argument `brew tap <name> <url>` install flow in README and
  the installation docs.

Closes #2218
- Checkout the repo with persist-credentials: false so the formula token is
  not left in the runner's git config during pnpm install / tsx; authenticate
  the branch push explicitly instead.
- Reuse an existing open PR for the formula branch so re-running the job for the
  same tag is idempotent rather than failing in gh pr create.
@dyoshikawa
dyoshikawa merged commit 6d38c21 into main Jul 12, 2026
10 checks passed
@dyoshikawa
dyoshikawa deleted the feat/homebrew-tap branch July 12, 2026 12:11
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa dyoshikawa mentioned this pull request Jul 14, 2026
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.

Ship rulesync via a self-contained Homebrew tap inside this repo (no separate homebrew-* repo)

2 participants