Skip to content

GoReleaser: Switch to homebrew_casks from brews#672

Open
tangrufus wants to merge 1 commit intoroots:masterfrom
tangrufus:goreleaser-brew-cask
Open

GoReleaser: Switch to homebrew_casks from brews#672
tangrufus wants to merge 1 commit intoroots:masterfrom
tangrufus:goreleaser-brew-cask

Conversation

@tangrufus
Copy link
Copy Markdown
Member

@tangrufus tangrufus commented Apr 15, 2026

GoReleaser has deprecated brews since v2.10 (June 8, 2025).

See: https://goreleaser.com/blog/goreleaser-v2.10/

Close #669


Homebrew shell completion installation is currently (v1.18.0) broken. Root cause is unknown.

$ brew install roots/tap/trellis-cli --verbose
==> Fetching downloads for: trellis-cli
==> Verifying checksum for 'b5d7e7afb6032aaaea51bfdbdfb93b7e230b7c13762998d0824abbdb19111b5f--trellis_Darwin_arm64.tar.gz'3.7MB/------
✔︎ Formula trellis-cli (1.18.0)                                                                              Verified     13.7MB/ 13.7MB
==> Installing trellis-cli from roots/tap
mv /private/tmp/homebrew-unpack-20260415-33846-8rr211/LICENSE /private/tmp/trellis-cli-20260415-33846-y79tce/LICENSE
mv /private/tmp/homebrew-unpack-20260415-33846-8rr211/README.md /private/tmp/trellis-cli-20260415-33846-y79tce/README.md
mv /private/tmp/homebrew-unpack-20260415-33846-8rr211/trellis /private/tmp/trellis-cli-20260415-33846-y79tce/trellis
==> Cleaning
==> Finishing up
ln -s ../Cellar/trellis-cli/1.18.0/bin/trellis trellis
==> Summary
🍺  /opt/homebrew/Cellar/trellis-cli/1.18.0: 6 files, 27.5MB, built in 0 seconds
==> Running `brew cleanup trellis-cli`...
Disable this behaviour by setting `HOMEBREW_NO_INSTALL_CLEANUP=1`.
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).

https://github.com/roots/homebrew-tap/blob/1f351691393a4c5d1a9979a41a7981b7fe078824/Formula/trellis-cli.rb#L47 is not triggered. My .zshrc wasn't modified. Thus, no shell completion is installed.


I couldn't add $ trellis--autocomplete-install to post-install hook because it cannot be ran twice:

$ trellis --autocomplete-install

# Second run returns error
$ trellis --autocomplete-install
1 error occurred:
        * already installed in /Users/work/.zshrc

My failed attempt:

      hooks:
        post:
          install: |
            if OS.mac?
              system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/trellis"]
            end
+         system_command "#{HOMEBREW_PREFIX}/bin/trellis", args: ["--autocomplete-install"]
+       pre:
+         uninstall: |
+           system_command "#{HOMEBREW_PREFIX}/bin/trellis", args: ["--autocomplete-uninstall"]

Migration

When we release the next tag, we have to delete https://github.com/roots/homebrew-tap/blob/master/Formula/trellis-cli.rb

If anyone using brew bundle:

- brew "roots/tap/trellis-cli"
+ cask "roots/tap/trellis-cli"

Comment thread .goreleaser.yml
caveats: |-
## Virtualenv

trellis-cli uses Virtualenv to manage dependencies such as Ansible which it
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This message basically replaces homebrew's broken autocomplete install? I'm good with this if so

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes.

I found no easy way to make homebrew install auto completion. Therefore, show the message to ask users to $ eval "$(trellis shell-init zsh)" and $ trellis --autocomplete-install manually

@tangrufus
Copy link
Copy Markdown
Member Author

Side note: Now with go install. I suggest we remove https://github.com/roots/homebrew-tap/blob/master/Formula/trellis-cli-dev.rb as well

@swalkinshaw
Copy link
Copy Markdown
Member

@tangrufus that's a good call

@swalkinshaw
Copy link
Copy Markdown
Member

Let's hold off on merging this for now. @retlehs brought up a good point that ideally we just get trellis-cli into Homebrew core but that would require the Formula running go build I believe

Casks are more correct for pre-built binaries but are generally associated with "desktop apps".

We will play the game if we have to, but if a formula requires go build i don't understand why people wouldn't just use go install

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.

GoReleaser: Switch to homebrew_casks from brews

2 participants