Skip to content

feat: Add Homebrew channel and install-aware updates#196

Open
gjtorikian wants to merge 3 commits into
to-bunfrom
homebrew-distribution
Open

feat: Add Homebrew channel and install-aware updates#196
gjtorikian wants to merge 3 commits into
to-bunfrom
homebrew-distribution

Conversation

@gjtorikian

Copy link
Copy Markdown
Contributor

Summary

  • Update notice is now channel-aware. detectInstallMethod() infers homebrew / npm / downloaded-binary from the running binary's process.execPath and prints the matching upgrade command (brew upgrade workos, npm install -g workos@latest, or the GitHub download link) instead of the one-size-fits-all link that rarely matched how the CLI was actually installed.
  • Homebrew joins npm as a release channel. A new publish-homebrew job regenerates the tap formula from the same published binaries and pushes it to workos/homebrew-tap on every stable release, so brew install workos/tap/workos and brew upgrade workos track releases instead of the hand-maintained, now-stale formula.
  • The formula can't drift from the bits. scripts/gen-homebrew-formula.ts computes each platform's sha256 from the release artifacts, rejects prereleases, and emits an audit-clean desc. Stable-only is enforced twice: the job is gated if: !contains(tag, '-') and the generator throws on prerelease versions.
  • Tests. install-method.spec.ts covers detection and upgrade strings across mac/Linuxbrew/npm/download paths; version-check.spec.ts pins the notice via a mock so the assertion no longer depends on the test runner's own execPath.

The update notice always pointed at the generic GitHub download
link, so the suggested action rarely matched how the CLI was
actually installed. It now infers the channel from the running
binary's path and prints the matching command — brew upgrade,
npm install -g, or the download link.

Homebrew joins npm as a supported channel: each stable release
regenerates the tap formula from the same published binaries and
pushes it to workos/homebrew-tap, keeping brew in lockstep with
releases instead of the hand-maintained, now-stale formula.
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Homebrew distribution and install-aware update notices. The main changes are:

  • Detect Homebrew, npm, and downloaded-binary installations.
  • Show an upgrade command matching the detected channel.
  • Generate and publish a stable Homebrew formula from release artifacts.
  • Add tests for install detection and update notices.

Confidence Score: 5/5

The latest fix looks safe to merge.

  • Windows npm paths are normalized before install-channel detection.
  • The added test covers the previously failing Windows path shape.
  • No additional publishable issue remains in this review round.

Important Files Changed

Filename Overview
src/lib/install-method.ts Adds channel detection and includes the Windows path-separator fix from the latest update.
src/lib/version-check.ts Uses the detected install channel to display the matching update instructions.
scripts/gen-homebrew-formula.ts Generates stable Homebrew formula entries and checksums from release binaries.
.github/workflows/release.yml Publishes the generated formula to the Homebrew tap for stable releases.

Reviews (2): Last reviewed commit: "ci: Push the Homebrew formula via the SD..." | Re-trigger Greptile

Comment thread src/lib/install-method.ts
The npm launcher's binary sits at …\node_modules\@workos\cli-win32-x64
\bin\workos.exe on Windows, whose backslashes never matched the
/node_modules/ marker — so Windows npm users were told to re-download
from GitHub Releases instead of running npm install -g. Normalize
separators before matching.
The SDK Automation Bot is already installed on workos/homebrew-tap
with contents write, so mint a tap-scoped installation token from it
instead of provisioning a dedicated PAT — one fewer secret to manage,
and it matches how the SDK repos already publish.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant