Skip to content

fix(ci): migrate .goreleaser.yaml off deprecated archives/brews APIs#292

Merged
AnnatarHe merged 1 commit into
mainfrom
fix/goreleaser-deprecated-apis
Jun 22, 2026
Merged

fix(ci): migrate .goreleaser.yaml off deprecated archives/brews APIs#292
AnnatarHe merged 1 commit into
mainfrom
fix/goreleaser-deprecated-apis

Conversation

@AnnatarHe

Copy link
Copy Markdown
Contributor

Why

The release workflow runs goreleaser release --clean with version: "~> v2". goreleaser check (v2.16.0) reports four deprecated properties that will eventually become hard errors:

DEPRECATED: archives.format
DEPRECATED: archives.format_overrides.format
DEPRECATED: archives.builds
DEPRECATED: brews

Changes

  • archives (both entries): format:formats: [...], builds:ids:, and format_overrides[].formatformats: [...].
  • brewshomebrew_casks: Homebrew Casks are macOS-only, so the tap becomes macOS-only.
    • binaries: [shelltime, shelltime-daemon] replaces the Ruby install block.
    • test stanza dropped (casks have none).
    • ids: [mac] only (drops the Linux/Windows mt-common archive).
    • directory: FormulaCasks.

Linux users continue installing via curl -sSL https://shelltime.xyz/i | bash. The GitHub-release archives (incl. Linux/Windows) are unchanged.

Verification

  • goreleaser check → passes, no deprecations.
  • goreleaser release --snapshot --clean --skip=publish → builds all 4 binaries, both archive formats, and generates dist/homebrew/Casks/shelltime.rb with binary "shelltime" + binary "shelltime-daemon" and caveats, scoped to macOS intel/arm.

Companion PR

Requires shelltime/homebrew-tap#NEW (adds tap_migrations.json, removes the old formula) so existing users auto-migrate to the cask. Land/release this CLI change first or together to avoid a window where the formula is gone but the cask isn't published yet.

🤖 Generated with Claude Code

GoReleaser v2 deprecated archives.format, archives.format_overrides.format,
archives.builds, and brews. Rename the archives fields to formats/ids and
migrate the Homebrew formula to a macOS-only homebrew_casks block (binaries
list replaces the install ruby block; the test stanza is dropped as casks
have none). Linux users continue installing via the curl script.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the .goreleaser.yaml configuration to align with GoReleaser v2 syntax, modifying archive formats and migrating the deprecated brews section. Feedback suggests using homebrews instead of homebrew_casks for distributing the CLI tool, as casks are intended for GUI applications. This change allows keeping the standard installation and test blocks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .goreleaser.yaml
Comment on lines +138 to 159
# 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

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

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project check has failed because the head coverage (78.88%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Flag Coverage Δ
unittests 78.88% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AnnatarHe

Copy link
Copy Markdown
Contributor Author

@claude ultrareview

@claude

claude Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Claude finished @AnnatarHe's task in 1m 11s —— View job


Ultra Code Review — PR #292

Todo:

  • Gather context from PR description and comments
  • Read .goreleaser.yaml (current + diff)
  • Evaluate homebrew_casks vs homebrews correctness
  • Check archive format migration correctness
  • Check for any other issues
  • Post final review

Summary

The archive deprecation fixes are clean and correct. The brewshomebrew_casks migration works but carries a meaningful trade-off that deserves a decision: it silently breaks the install command for existing users and deviates from Homebrew conventions for CLI tools. Gemini's concern is valid.


Archive Changes (.goreleaser.yaml lines 55–85) — ✅ Correct

All three archive deprecations are migrated correctly:

Old (deprecated) New
format: tar.gz formats: [tar.gz]
builds: [...] ids: [...]
format_overrides[].format: zip format_overrides[].formats: [zip]

Both archive entries (mt-common and mac) are updated consistently. No issues.


brewshomebrew_casks⚠️ Functional, but consider homebrews instead

This is the substantive design decision in the PR, and Gemini's review is correct.

What the PR does: Migrates to homebrew_casks, which publishes to Casks/shelltime.rb in the tap. Homebrew Casks are designed for GUI applications and large binary packages distributed as .dmg/.zip.

The problem: shelltime is a CLI tool. Homebrew's own guidelines explicitly reserve Casks for GUI apps. The practical consequences:

  1. Breaking install command for existing users. Today: brew install shelltime/tap/shelltime. After this: brew install --cask shelltime/tap/shelltime. The companion tap PR's tap_migrations.json handles auto-migration for existing installs, but the install instructions everywhere (docs, README, shelltime.xyz/i) will need updating.

  2. Drops brew test. The test stanza is gone because Casks don't support it. With homebrews, you get brew test shelltime to verify the install works.

  3. Same macOS-only goal is achievable with homebrews. The PR states macOS-only as the motivation, but homebrews also supports ids: [mac] to scope it to the macOS archive. No trade-off needed.

If the goal is strictly "fix the deprecation, keep macOS-only", the simpler and convention-correct path is homebrews (as Gemini suggested):

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

      Or set things up manually:
        shelltime auth
        shelltime hooks install
        shelltime daemon install

      Learn more at https://shelltime.xyz

This resolves all four deprecations, keeps directory: Formula, restores the test stanza, and doesn't change the user-facing install command.

Fix this →


Minor Notes

  • .goreleaser.yaml:138 — the comment # Homebrew Casks are macOS-only is true but would be unnecessary if switching to homebrews (since ids: [mac] self-documents the macOS scope).
  • ids: [mt-common] was removed from the Homebrew section (old brews referenced both mt-common and mac). The current ids: [mac] correctly limits to the macOS zip archive. ✓
  • allow_different_binary_count: true is correctly preserved in both archive entries. ✓

Verdict

Merge blocker? No — the PR passes goreleaser check and fixes the deprecations. But strongly recommend switching to homebrews before merging. The cask migration introduces a user-visible breaking change in the install command and deviates from Homebrew conventions — both avoidable if using homebrews. This also makes the companion homebrew-tap PR unnecessary (no tap_migrations.json needed).

@AnnatarHe AnnatarHe merged commit fb5bcdb into main Jun 22, 2026
5 of 6 checks passed
@AnnatarHe AnnatarHe deleted the fix/goreleaser-deprecated-apis branch June 22, 2026 05:18
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.

1 participant