Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ builds:
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser -X main.uptraceDsn={{.Env.UPTRACE_DSN}}
archives:
- format: tar.gz
- formats: [tar.gz]
id: mt-common
allow_different_binary_count: true
builds:
ids:
- mt-common
- mt-daemon-linux
# this name template makes the OS and Arch compatible with the results of uname.
Expand All @@ -69,11 +69,11 @@ archives:
# use zip for windows archives
format_overrides:
- goos: windows
format: zip
- format: zip
formats: [zip]
- formats: [zip]
id: mac
allow_different_binary_count: true
builds:
ids:
- mt-mac
- mt-daemon-mac
name_template: >-
Expand Down Expand Up @@ -135,27 +135,25 @@ notarize:
key_id: "{{.Env.QUILL_NOTARY_KEY_ID}}"
key: "{{.Env.QUILL_NOTARY_KEY}}"
wait: true
brews:
# Homebrew Casks are macOS-only; Linux users install via the curl script.
homebrew_casks:
- name: shelltime
ids:
- mt-common
- mac
binaries:
- shelltime
- shelltime-daemon
repository:
owner: shelltime
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
directory: Formula
directory: Casks
homepage: "https://shelltime.xyz"
description: "Track and analyze your shell usage - ShellTime CLI"
license: "MIT"
commit_author:
name: shelltime-bot
email: bot@shelltime.xyz
install: |
bin.install "shelltime"
bin.install "shelltime-daemon"
test: |
system "#{bin}/shelltime", "--version"
caveats: |
Get started with a single command:
shelltime init
Comment on lines +138 to 159

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

In GoReleaser v2, the direct replacement for the deprecated brews section is homebrews, not homebrew_casks.

Using homebrew_casks packages the CLI tool as a Homebrew Cask, which is designed for macOS GUI applications or large binary packages. Standard CLI tools should be distributed as Homebrew Formulas (homebrews).

By migrating to homebrews instead of homebrew_casks:

  1. You adhere to Homebrew's guidelines (Formulas for CLI tools, Casks for GUI apps).
  2. You can keep the test block to verify the installation works.
  3. You can keep the standard Ruby install block.
  4. You can still restrict the formula to macOS-only by keeping ids: [mac].
# Homebrew Formulas are standard for CLI tools; Linux users install via the curl script.
homebrews:
  - name: shelltime
    ids:
      - mac
    repository:
      owner: shelltime
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
    directory: Formula
    homepage: "https://shelltime.xyz"
    description: "Track and analyze your shell usage - ShellTime CLI"
    license: "MIT"
    commit_author:
      name: shelltime-bot
      email: bot@shelltime.xyz
    install: |
      bin.install "shelltime"
      bin.install "shelltime-daemon"
    test: |
      system "#{bin}/shelltime", "--version"
    caveats: |
      Get started with a single command:
        shelltime init

Expand Down
Loading