Skip to content

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented May 21, 2025

  • add a new homebrew_casks root configuration
  • copy the brew pipe into a new one and make the required changes so it generates casks instead of formulae
  • deprecate the old brews
  • document how to migrate - e.g. user will need to delete old formula from the /Formula folder, new default should be Cask
  • test zap
  • test completions
  • test manpages
  • document new section
  • deprecate old section

closes #5607
closes #5594

refs https://github.com/Homebrew/brew/blob/master/docs/Cask-Cookbook.md

caarlos0 added 4 commits May 20, 2025 23:42
- rename cask.rb to formula.rb
- change type to BrewFormula instead of BrewTap
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 self-assigned this May 21, 2025
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 21, 2025
@caarlos0 caarlos0 added enhancement New feature or request and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 21, 2025
@pull-request-size pull-request-size bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 21, 2025
Copy link

cloudflare-workers-and-pages bot commented May 21, 2025

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: c2eb36d
Status: ✅  Deploy successful!
Preview URL: https://a6a332ba.goreleaser.pages.dev
Branch Preview URL: https://newb.goreleaser.pages.dev

View logs

Copy link
Contributor

@SMillerDev SMillerDev left a comment

Choose a reason for hiding this comment

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

Looking great! Thanks so much for the work, just a few nits to make it official quality.

caarlos0 and others added 5 commits May 22, 2025 09:42
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
Co-authored-by: Sean Molenaar <SMillerDev@users.noreply.github.com>
Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 82.92683% with 63 lines in your changes missing coverage. Please review.

Project coverage is 82.93%. Comparing base (78104b3) to head (5a72d6c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/pipe/cask/cask.go 79.27% 46 Missing and 17 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5780      +/-   ##
==========================================
- Coverage   82.93%   82.93%   -0.01%     
==========================================
  Files         161      163       +2     
  Lines       15932    16292     +360     
==========================================
+ Hits        13214    13511     +297     
- Misses       2144     2190      +46     
- Partials      574      591      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@caarlos0 caarlos0 requested a review from Copilot May 22, 2025 13:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for generating Homebrew casks alongside deprecating the old brews pipe. Key changes include:

  • Introduces a new homebrew_casks configuration and corresponding template logic under internal/pipe/cask
  • Deprecates the old brews pipe and updates related constants and behavior
  • Provides golden test data for cask output and updates the main .goreleaser.yaml to use casks

Reviewed Changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.goreleaser.yaml Replaced brews section with homebrew_casks
internal/pipe/cask/templates/linux_packages.rb Added Linux package blocks for casks
internal/pipe/cask/templates/macos_packages.rb Added macOS package blocks for casks
internal/pipe/cask/templates/cask.rb Main cask template generating full Ruby casks
internal/pipe/cask/template.go Data struct and embedding for cask templates
internal/pipe/brew/brew.go & brew_test.go Deprecation notices and updated constants
internal/artifact/artifact.go Introduced BrewCask type alongside BrewFormula
internal/pipe/cask/testdata/TestFullPipe/*.golden Golden files for cask pipeline tests
Comments suppressed due to low confidence (3)

.goreleaser.yaml:221

  • The YAML key homebrew_casks may not align with the Go struct field HomebrewCask (singular). Verify the mapping or rename the key to match the struct name.
homebrew_casks:

internal/pipe/cask/template.go:1

  • [nitpick] There are no unit tests for the new cask pipe implementation. Consider adding tests under internal/pipe/cask to validate template rendering and publishing workflows.
package cask

internal/pipe/cask/templates/linux_packages.rb:7

  • [nitpick] The ARM block nesting is misaligned: the if inside this branch doesn't match a corresponding do/end for an on_arm block. Consider using on_arm do ... end consistently and ensure each conditional block is properly closed.
{{- else if eq $element.Arch "arm" }}

Copy link
Contributor

@SMillerDev SMillerDev left a comment

Choose a reason for hiding this comment

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

Okay, couple more notes.

@caarlos0
Copy link
Member Author

Gonna merge this so it gets in the next nightly builds!

Thanks so much for all the help and support here @SMillerDev! Really appreciate it <3
Feel free to comment if you have any other pointers 🙏

@caarlos0 caarlos0 merged commit c8fd3bd into main May 23, 2025
14 of 16 checks passed
@caarlos0 caarlos0 deleted the newb branch May 23, 2025 23:54
@SMillerDev
Copy link
Contributor

Thanks for the work here! Very happy to see the situation improved for both Homebrew and Goreleaser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Brew packages should be casks instead formulae
3 participants