Skip to content

feat: add Homebrew tap support#16

Merged
stn1slv merged 6 commits into
mainfrom
feature/homebrew
Mar 19, 2026
Merged

feat: add Homebrew tap support#16
stn1slv merged 6 commits into
mainfrom
feature/homebrew

Conversation

@stn1slv
Copy link
Copy Markdown
Owner

@stn1slv stn1slv commented Mar 19, 2026

Summary

  • Release workflow now produces .tar.gz archives alongside raw binaries
  • Added update-homebrew job that auto-updates the formula in stn1slv/homebrew-tap on each release (computes SHA256, pushes via GitHub API)
  • Updated README with Homebrew installation instructions

Setup

Requires HOMEBREW_TAP_TOKEN secret (already configured) — a PAT with repo scope for pushing to stn1slv/homebrew-tap.

Test plan

  • Merge and tag a new release
  • Verify .tar.gz assets appear in the GitHub release
  • Verify the formula is auto-updated in stn1slv/homebrew-tap
  • Run brew install stn1slv/tap/http-proxy-logger and confirm http-proxy-logger -help works

Change the release build to produce a generic binary, create per-platform tarballs (http-proxy-logger_${GOOS}_${GOARCH}.tar.gz), and then rename the raw binary for backward compatibility with existing asset names. Add the tarballs to the release assets list. Introduce an update-homebrew job that runs after release: it extracts the semantic version from the tag, downloads darwin tarballs to compute SHA256 sums, generates a Homebrew formula (formula.rb) with the correct URLs and checksums, and updates or creates the formula in the stn1slv/homebrew-tap repo via the GitHub API using HOMEBREW_TAP_TOKEN.
Rename 'Building' to 'Installation', add a Homebrew install section with brew install command, introduce a 'From source' subsection, and update the minimum Go requirement from 1.23 to 1.26+. Also tweak the Docker image heading for clarity.
@stn1slv stn1slv changed the title Publish tarballs and add Homebrew update job for releases feat: add Homebrew tap support Mar 19, 2026

This comment was marked as resolved.

Make the release workflow more robust and macOS-specific: add --retry 3 --retry-delay 5 to curl invocations (downloads, GET for existing formula, and PUT upload) to reduce transient failures; wrap Homebrew bottle URLs in an on_macos block so the formula DSL only sets macOS-specific URLs; and replace fragile grep parsing with jq to reliably extract the existing file SHA.

This comment was marked as resolved.

Relax error handling in the release workflow: remove the explicit expected exit code from the formula test (no longer asserting exit status 2), and make the GitHub API file-SHA lookup more tolerant. Curl no longer uses -f and jq stderr is redirected with a fallback (|| true) so the script won’t fail the job when the file is missing or the API returns non-JSON/HTTP errors.

This comment was marked as resolved.

Add robustness to the release workflow's Homebrew tap update: if HOMEBREW_TAP_TOKEN is not set, emit a warning and skip the update step instead of failing; mark the generated formula as macOS-only with depends_on :macos; and make the GitHub API check more reliable by capturing HTTP status, handling 404 (new file) and 200 (existing file) explicitly, and failing with diagnostics on other response codes.

This comment was marked as resolved.

Add instructions for downloading pre-built binaries from the Releases page (Linux/Windows/macOS) with an example curl + chmod + mv for linux-amd64. Replace the Docker build example with a `docker pull` and move the "From source" section below Docker while keeping the Go 1.26+ requirement.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Homebrew tap distribution support by enhancing the release pipeline to publish archive assets and automatically update the stn1slv/homebrew-tap formula, along with documenting new installation options.

Changes:

  • Release workflow now builds and uploads .tar.gz archives in addition to existing raw binaries.
  • Added an update-homebrew job that computes SHA256 for macOS tarballs and updates the Homebrew formula in stn1slv/homebrew-tap via the GitHub Contents API.
  • Updated README with Homebrew, direct-download, Docker, and source installation instructions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
README.md Adds installation guidance (Homebrew, downloads, Docker, source).
.github/workflows/release.yml Produces tarball release assets and auto-updates the Homebrew tap formula on tag releases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread README.md
Comment on lines +74 to +77
### From source

Requires **Go 1.26+**.

@stn1slv stn1slv merged commit 230c952 into main Mar 19, 2026
6 checks passed
@stn1slv stn1slv deleted the feature/homebrew branch March 19, 2026 17:25
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