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`).