feat: add Homebrew tap support#16
Merged
Merged
Conversation
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.
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.
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.
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.
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.
There was a problem hiding this comment.
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.gzarchives in addition to existing raw binaries. - Added an
update-homebrewjob that computes SHA256 for macOS tarballs and updates the Homebrew formula instn1slv/homebrew-tapvia 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 on lines
+74
to
+77
| ### From source | ||
|
|
||
| Requires **Go 1.26+**. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.tar.gzarchives alongside raw binariesupdate-homebrewjob that auto-updates the formula instn1slv/homebrew-tapon each release (computes SHA256, pushes via GitHub API)Setup
Requires
HOMEBREW_TAP_TOKENsecret (already configured) — a PAT withreposcope for pushing tostn1slv/homebrew-tap.Test plan
.tar.gzassets appear in the GitHub releasestn1slv/homebrew-tapbrew install stn1slv/tap/http-proxy-loggerand confirmhttp-proxy-logger -helpworks