feat(release): distribute the CLI via Homebrew tap#111
Conversation
Add automated Homebrew distribution for @pleaseai/ask, mirroring the pleaseai/asana setup. On every CLI release, release.yml now: - builds standalone bun --compile binaries for darwin/linux x64/arm64 - attaches them (and their .sha256 sums) to the ask-v* GitHub release - regenerates ask.rb in pleaseai/homebrew-tap via a GitHub App token The compiled binary has no package.json on disk, so version resolution in src/index.ts now prefers a compile-time literal (__ASK_VERSION__, injected with bun's --define) and falls back to reading package.json for the npm/tsc build. Docs: add an "Install the CLI" section (brew + npm) to the README.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Deploying ask with
|
| Latest commit: |
1b8f1ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a00bd60a.ask-6im.pages.dev |
| Branch Preview URL: | https://amondnet-homebrew.ask-6im.pages.dev |
Deploying ask-registry with
|
| Latest commit: |
1b8f1ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b3e7e69d.ask-registry.pages.dev |
| Branch Preview URL: | https://amondnet-homebrew.ask-registry.pages.dev |
There was a problem hiding this comment.
1 issue found across 3 files
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant GH as GitHub
participant GHA as GitHub Actions
participant Bun as Bun Build
participant Dist as dist-bin
participant Release as GitHub Release
participant Tap as homebrew-tap Repo
participant User as End User
Note over Dev,User: NEW: Homebrew Distribution Flow
Dev->>GH: Push to main branch
GH->>GHA: Trigger release.yml workflow
GHA->>GHA: Run release-please job
alt cli_release_created == 'true'
GHA->>GHA: Start build-binaries job
GHA->>Bun: Checkout code + setup bun
GHA->>Bun: Install dependencies
GHA->>Bun: Build schema workspace
Bun->>Bun: Cross-compile 4 targets (darwin/linux × x64/arm64)
Note over Bun: Injects __ASK_VERSION__ via --define
Bun->>Dist: Write ask-{target} binaries
Dist->>Dist: Generate .sha256 checksums
Dist->>GHA: Upload ask-binaries artifact
else
GHA->>GHA: Skip CLI release jobs
end
Note over GHA,Release: Upload binaries to GitHub Release
GHA->>GHA: Start upload-release-assets job
GHA->>Release: Download ask-binaries artifact
Release->>Release: gh release upload binaries + sha256 files
Note over Release,Tap: Update Homebrew formula
GHA->>GHA: Start update-homebrew-formula job
GHA->>GH: Request GitHub App token (APP_ID + PRIVATE_KEY)
GH-->>GHA: Return app token
GHA->>Tap: Checkout pleaseai/homebrew-tap repo (with app token)
GHA->>Release: Download .sha256 files from release assets
Release-->>GHA: Checksum files
GHA->>Tap: Generate ask.rb with version + sha256 sums
Tap->>Tap: Commit + push ask.rb to homebrew-tap
Note over User,Tap: End-user install
User->>User: Run "brew install pleaseai/tap/ask"
User->>Tap: Homebrew fetches formula from tap
User->>Release: Download compiled binary for platform
User->>User: Binary runs without Node.js
Note over Bun,User: Version Resolution (compile-time vs runtime)
alt Compiled binary (Homebrew)
Bun->>Bun: __ASK_VERSION__ defined as string literal
User->>User: resolveVersion() returns __ASK_VERSION__
else npm/tsc build
Bun->>Bun: __ASK_VERSION__ undefined
User->>User: resolveVersion() reads package.json
alt package.json missing
User->>User: Falls back to '0.0.0'
end
end
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
git diff --quiet ignores untracked files, so the very first ask.rb creation in homebrew-tap would be detected as 'no changes' and never committed. Also require the file to be tracked before skipping.
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Requires human review: Adds new CI release jobs building cross-platform binaries and updating Homebrew tap, plus compile-time version resolution logic. These are infrastructure/deployment changes that modify release workflows and core version handling, which require human review to ensure correctness and security.
Re-trigger cubic
Summary
Adds automated Homebrew distribution for
@pleaseai/ask, mirroring thepleaseai/asanasetup. Users can now install the CLI as a standalone binary (no Node.js required):What changed
.github/workflows/release.yml— three new jobs gated oncli_release_created, running downstream of the existingrelease-pleasejob:build-binaries— single ubuntu runner,bun build --compilecross-compiles 4 targets (darwin/linux × x64/arm64) +.sha256sumsupload-release-assets— attaches binaries to theask-v*GitHub releaseupdate-homebrew-formula— regeneratesask.rbinpleaseai/homebrew-tapvia a GitHub App token (commit + push)packages/cli/src/index.ts— compile-safe version resolution. The compiled binary has nopackage.jsonon disk, so version now prefers a compile-time literal (__ASK_VERSION__, injected via bun--define) and falls back to readingpackage.jsonfor the npm/tscbuild.README.md— new "Install the CLI" section (brew + npm); the old dev-build section is relabeled "Development".APP_ID/PRIVATE_KEYsecrets must exist onpleaseai/ask, and the GitHub App must be installed on bothaskandhomebrew-tapwith contents: write (reusing the asana App is simplest).ask.rbis created on the first release run — no need to pre-create it.Verification
ask --version→ correct version (gotcha fixed); npm/tscfallback also correcteslintcleanask.rb(heredoc dedent) produces valid Ruby structure matching asana's proven formula🤖 Generated with Claude Code
Summary by cubic
Distribute the
@pleaseai/askCLI via a Homebrew tap so users can install a standalone binary withbrew install pleaseai/tap/ask(no Node.js required). The release workflow builds cross-platform binaries and updates thepleaseai/homebrew-tapformula; requires GitHub App secretsAPP_ID/PRIVATE_KEYonaskandhomebrew-tap.New Features
bun --compilebinaries for macOS/Linux (x64/arm64), uploads them with.sha256sums, and regeneratesask.rbinpleaseai/homebrew-tap.__ASK_VERSION__(injected bybun --define), with apackage.jsonfallback for thenpm/tsc build.npm).Bug Fixes
ask.rbcreation is committed by requiring the file to be tracked before treating the update as a no-op.Written for commit 1b8f1ed. Summary will update on new commits.