From 2175e95ac5a8f0ca582ffa0f8ac91bcf34b4b0e9 Mon Sep 17 00:00:00 2001 From: Andrei Taranik Date: Fri, 22 May 2026 23:13:51 +0300 Subject: [PATCH] build(release): publish brew cask to remetric-dev/homebrew-tap on each tag GoReleaser v2.10 deprecated `brews:` in favour of `homebrew_casks:`, which matches its prebuilt-binary distribution model better than legacy Formula recipes. The release workflow now pushes a Cask file to `remetric-dev/homebrew-tap/Casks/remetric.rb` on every tag. After-merge user-facing install: brew install remetric-dev/tap/remetric README and docs/getting-started point at the new command. The README "What's still missing" entry that said "No Homebrew tap" is removed. The release job needs a new repo secret HOMEBREW_TAP_TOKEN: a fine-grained PAT with `contents: write` on remetric-dev/homebrew-tap. The empty tap repo also needs to exist before the first tag after this PR. These are manual steps documented in the PR description. --- .github/workflows/release.yml | 5 +++++ .goreleaser.yml | 19 +++++++++++++++++++ README.md | 19 +++++++++++++++++-- docs/getting-started.md | 6 ++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 97cd646..d6d43bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,3 +33,8 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # PAT with `contents: write` on remetric-dev/homebrew-tap. + # Required for goreleaser to push the brew formula on every tag. + # If the secret is missing the release job fails fast with a + # clear "missing env" error before any artifacts are uploaded. + HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index ac06b64..f2e6520 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -85,6 +85,25 @@ docker_manifests: - "ghcr.io/remetric-dev/remetric:latest-amd64" - "ghcr.io/remetric-dev/remetric:latest-arm64" +homebrew_casks: + - name: remetric + repository: + owner: remetric-dev + name: homebrew-tap + branch: main + token: "{{ .Env.HOMEBREW_TAP_TOKEN }}" + directory: Casks + homepage: "https://remetric.dev" + description: "Re-metric your stack - find waste in Prometheus, Grafana & Loki" + binary: "remetric" + commit_author: + name: "remetric-dev-bot" + email: "noreply@remetric.dev" + # Publish on every tag, including pre-releases (v0.1.0-rc.N), so we can + # validate the tap end-to-end before v0.1.0. Switch to `auto` post-v0.1 + # if you want to stop polluting the tap with alphas. + skip_upload: "false" + release: prerelease: auto draft: false diff --git a/README.md b/README.md index bd89937..5becb94 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,22 @@ Installs the latest release into `$HOME/.local/bin`. Override with `REMETRIC_INSTALL_DIR=/usr/local/bin sh install.sh` (may need `sudo`) or pin a specific version via `REMETRIC_VERSION=v0.1.0 sh install.sh`. +### Homebrew (macOS / Linux) + +```bash +brew install remetric-dev/tap/remetric +``` + +Or, two-line for shorter subsequent invocations: + +```bash +brew tap remetric-dev/tap +brew install remetric +``` + +The formula is auto-published on each release from +[`remetric-dev/homebrew-tap`](https://github.com/remetric-dev/homebrew-tap). + ### Docker Multi-arch image (`linux/amd64`, `linux/arm64`). @@ -263,9 +279,8 @@ class with detection rules, fix snippets, and false-positive notes. ## What's still missing in v0.1 - No dashboard sprawl analyzer. -- No Homebrew tap (binaries + Docker image already ship; see Install above). -These land in subsequent releases. +This lands in a subsequent release. ## CI integration diff --git a/docs/getting-started.md b/docs/getting-started.md index f90b793..011db4a 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -13,6 +13,12 @@ curl -sSL https://remetric.dev/install.sh | sh Override the destination with `REMETRIC_INSTALL_DIR=/usr/local/bin sh install.sh`, or pin a specific version via `REMETRIC_VERSION=v0.1.0 sh install.sh`. +On macOS or Linux with [Homebrew](https://brew.sh): + +```bash +brew install remetric-dev/tap/remetric +``` + Prefer containers? A multi-arch image is published as `ghcr.io/remetric-dev/remetric:latest` (`linux/amd64`, `linux/arm64`).