Skip to content

Support Homebrew install#279

Open
sdairs wants to merge 3 commits into
mainfrom
issue-276-homebrew-install
Open

Support Homebrew install#279
sdairs wants to merge 3 commits into
mainfrom
issue-276-homebrew-install

Conversation

@sdairs

@sdairs sdairs commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #276.

Summary

Adds Homebrew tap support for clickhousectl using prebuilt binaries from builds.clickhouse.com.

  • homebrew/clickhousectl.rb.tmpl — formula template with per-platform url/sha256 blocks (macOS/Linux x86_64/aarch64), chctl symlink, --version test
  • scripts/update-homebrew-formula.sh — release-time script that downloads the 4 GitHub release archives, computes SHA256, renders the template, and pushes to ClickHouse/homebrew-tap via SSH deploy key
  • .github/workflows/release.ymlpublish-homebrew job in the release-publishing environment
  • .github/workflows/test-install.yml — CI job for Ruby syntax check + shellcheck
  • README.md, AGENTS.md, bug_report.yml — docs and template updates

Setup completed

  • ClickHouse/homebrew-tap repo created and populated with Formula/clickhousectl.rb (v0.3.1)
  • SSH deploy key added to ClickHouse/homebrew-tap (write access)
  • HOMEBREW_TAP_DEPLOY_KEY secret set in release-publishing environment
  • Verified end-to-end: brew install clickhouse/tap/clickhousectl--versionbrew test all pass

Install

brew install clickhouse/tap/clickhousectl

Add Homebrew tap formula for clickhousectl using prebuilt binaries from
builds.clickhouse.com. Includes:
- homebrew/clickhousectl.rb.tmpl: formula template with per-platform
  url/sha256 blocks (macOS/Linux x86_64/aarch64), chctl symlink, --version test
- scripts/update-homebrew-formula.sh: release-time script that downloads
  GitHub release archives, computes SHA256, renders the template, and
  pushes to ClickHouse/homebrew-tap via SSH deploy key
- .github/workflows/release.yml: publish-homebrew job (release-publishing env)
- .github/workflows/test-install.yml: CI job for Ruby syntax + shellcheck
- README.md, AGENTS.md, bug_report.yml: docs/template updates
@sdairs
sdairs requested a review from iskakaushik as a code owner July 4, 2026 20:50
Comment thread scripts/update-homebrew-formula.sh Outdated
Comment thread scripts/update-homebrew-formula.sh Outdated
Comment thread scripts/update-homebrew-formula.sh Outdated
- Add HEAD check for each builds.clickhouse.com URL before publishing
  the formula. Fails fast with a clear message if the mirror hasn't
  propagated the release yet, instead of shipping 404 URLs.
- Guard git commit with diff --cached --quiet so a re-run of the
  release job doesn't fail under set -e when the formula is already
  up to date.
Comment thread homebrew/clickhousectl.rb.tmpl Outdated
- name: Update Homebrew formula
env:
HOMEBREW_TAP_DEPLOY_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}
run: ./scripts/update-homebrew-formula.sh "${{ steps.version.outputs.version }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Homebrew ignores Cargo tag alignment

Medium Severity

The new publish-homebrew job sets the formula version from the git tag and runs brew test-style checks against the binary, but release archives still come from the existing build job, which never realigns crates/clickhousectl/Cargo.toml to the tag. The build-wheels job already documents and fixes that mismatch for PyPI; Homebrew can publish a tap version that does not match --version from the shipped binary when the tag was pushed without a Cargo bump.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 84d0f9f. Configure here.

Comment thread scripts/update-homebrew-formula.sh Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9e8d2d6. Configure here.

exit 1
fi
echo " OK"
done

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mirror SHA256 never verified

Medium Severity

The update script records SHA256 from GitHub release downloads but only sends HTTP HEAD to builds.clickhouse.com before publishing the formula. Homebrew installs fetch those builds URLs and verify the embedded checksum. If mirror bytes differ from GitHub, the tap can ship with hashes that fail every install.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9e8d2d6. Configure here.

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.

Support homebrew install

1 participant