Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Dec 29, 2025

Summary

This PR addresses two issues with the Brew target from #391:

  1. Prerelease skip: Homebrew doesn't understand prerelease versions like 2.0.0-beta.0, so the Brew target now skips publishing for any preview/prerelease version.

  2. Mustache templating for formula names: The formula config option now supports Mustache-style templates with version variables, allowing versioned formula names that prevent older major patches from overriding newer versions.

Usage

brew:
  tap: getsentry/tools
  formula: 'sentry-cli-v{{{major}}}'  # Creates sentry-cli-v1, sentry-cli-v2, etc.
  template: |
    class SentryCliV{{ major }} < Formula
      # ...
    end

Supported template variables

  • {{{version}}}: Full version string (e.g., "10.2.3")
  • {{{major}}}: Major version number (e.g., "10")
  • {{{minor}}}: Minor version number (e.g., "2")
  • {{{patch}}}: Patch version number (e.g., "3")

This follows the same pattern as the AWS Lambda Layer target's layerName templating.

Fixes #391.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • (brew) Skip prereleases and add mustache templating for formula names by BYK in #682
  • (changelog) Disable author mentions in PR preview comments by BYK in #684
  • (github) Clean up orphaned draft releases on publish failure by BYK in #681
  • (publish) Fail early on dirty git repository by BYK in #683

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review December 29, 2025 17:23
@BYK BYK requested a review from armcknight December 29, 2025 17:24
Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

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

The strategy looks good to help mitigate the last-write-wins issue with homebrew. I can't really help with typescript language/framework details here though.

Comment on lines +179 to +185
// Skip pre-release versions as Homebrew doesn't understand them
if (isPreviewRelease(version)) {
this.logger.info(
'Skipping Homebrew release for pre-release version: ' + version
);
return undefined;
}
Copy link
Member

Choose a reason for hiding this comment

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

👍🏻

@BYK BYK merged commit 75fdeb7 into master Jan 8, 2026
14 checks passed
@BYK BYK deleted the byk/fix-brew-prerelease-versioning branch January 8, 2026 21:06
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.

Prevent releasing beta versions and newer major overrides for Brew releases

4 participants