From 2e94b5a06e0bd2d73347939e776629027f718b4e Mon Sep 17 00:00:00 2001 From: hmk Date: Mon, 11 May 2026 16:26:58 -0700 Subject: [PATCH] feat(install): publish a homebrew cask to hmk/homebrew-tap on each release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds homebrew_casks block to .goreleaser.yaml so every release auto-pushes a Cask formula to hmk/homebrew-tap. Users can then: brew install hmk/tap/try-bedazzled The cask wires the binary into Homebrew's prefix and prints a caveats block with the shell-rc snippet (eval "$(try init)") since brew doesn't edit rc files itself. Why a generic homebrew-tap (not homebrew-try-bedazzled): the install path becomes hmk/tap/try-bedazzled instead of hmk/try-bedazzled/try-bedazzled. Cleaner, and leaves room for sibling tools later. Why a cask (not a formula): goreleaser's `brews` block was deprecated in favor of `homebrew_casks`. Casks work fine for CLIs — Homebrew doesn't strictly distinguish between GUI/CLI artifacts here. The HOMEBREW_TAP_TOKEN secret is a fine-grained PAT scoped to just the tap repo with Contents:write — minimum surface to push the formula. README now leads with `brew install hmk/tap/try-bedazzled`, with the install script as the cross-platform fallback. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 1 + .goreleaser.yaml | 28 ++++++++++++++++++++++++++++ INSTALL.md | 10 +++++++++- README.md | 10 +++++++++- 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00419b4..21b8885 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,7 @@ jobs: MACOS_NOTARY_ISSUER_ID: ${{ vars.MACOS_NOTARY_ISSUER_ID }} MACOS_NOTARY_KEY_ID: ${{ vars.MACOS_NOTARY_KEY_ID }} MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }} + HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} - name: Upload snapshot dist (dry-run only) if: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6197580..84602f0 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -62,6 +62,34 @@ nfpms: - rpm bindir: /usr/bin +homebrew_casks: + - name: try-bedazzled + binaries: + - try + repository: + owner: hmk + name: homebrew-tap + branch: main + token: "{{ .Env.HOMEBREW_TAP_TOKEN }}" + homepage: https://github.com/hmk/try-bedazzled + description: A beautiful, themeable directory manager for try experiments + license: BSD-3-Clause + commit_author: + name: goreleaserbot + email: bot@goreleaser.com + commit_msg_template: "chore(cask): bump try-bedazzled to {{ .Tag }}" + caveats: | + To enable the `try` shell function (so Enter actually `cd`s your shell), + add this line to your shell config: + + # bash / zsh + eval "$(try init)" + + # fish + try init | source + + Then restart your shell. + changelog: sort: asc filters: diff --git a/INSTALL.md b/INSTALL.md index bf673dc..93ed5e7 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,6 +1,14 @@ # Install -The fast path is the install script in the [README](README.md). This file covers the alternatives. +The fast paths are in the [README](README.md): Homebrew or the install script. This file covers the alternatives. + +## Homebrew + +```bash +brew install hmk/tap/try-bedazzled +``` + +This taps `hmk/homebrew-tap` (one-time) and installs the cask. Upgrades work via `brew upgrade try-bedazzled`. The cask prints a one-line shell-config snippet on install — see "Manual shell setup" at the bottom of this file if you missed it. ## Install script options diff --git a/README.md b/README.md index 7e31fee..a98dc1a 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,21 @@ Type to filter. Press Enter to `cd`. Type a new name and press Enter to create. ## Install +**Homebrew** (macOS, Linux): + +```bash +brew install hmk/tap/try-bedazzled +``` + +**curl** (everywhere else): + ```bash curl -fsSL https://raw.githubusercontent.com/hmk/try-bedazzled/main/install.sh | sh ``` Then restart your shell (or `source ~/.zshrc`) and run `try`. -The installer downloads the latest release for your platform, drops the binary in `/usr/local/bin/`, and adds the shell function to your rc file. macOS binaries are signed and notarized. +The curl installer drops the signed-and-notarized binary in `/usr/local/bin/` and adds the shell function to your rc file. The Homebrew formula prints the same one-line shell-config snippet on first install (`brew info try-bedazzled`). For other install paths (Go, manual download, custom directory), see [INSTALL.md](INSTALL.md).