From cbb7fda613d3469a532063523e07e3139597771a Mon Sep 17 00:00:00 2001 From: Michele Mancioppi Date: Wed, 4 Mar 2026 18:33:27 +0100 Subject: [PATCH] chore: migrate to brew cask --- .chloggen/worktree-migrate-brew.yaml | 29 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 12 ++++++++++++ .goreleaser.yaml | 21 +++++++++++++------- README.md | 6 +++++- tap_migrations.json | 3 +++ 5 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .chloggen/worktree-migrate-brew.yaml create mode 100644 tap_migrations.json diff --git a/.chloggen/worktree-migrate-brew.yaml b/.chloggen/worktree-migrate-brew.yaml new file mode 100644 index 0000000..647c7ee --- /dev/null +++ b/.chloggen/worktree-migrate-brew.yaml @@ -0,0 +1,29 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern (e.g. dashboards, config, apply) +component: install + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Migrate Homebrew distribution from Formula to Cask + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [82] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + The `dash0` CLI is now distributed as a Homebrew Cask instead of a Formula. + Existing users are migrated automatically via `tap_migrations.json` when running `brew update`. + Install with `brew install --cask dash0hq/dash0-cli/dash0`. + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with "chore" or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Default: '[user]' +change_logs: [] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7e6952..5b75aee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,3 +51,15 @@ jobs: args: release --clean --release-notes release-notes.md env: GITHUB_TOKEN: ${{ secrets.REPOSITORY_FULL_ACCESS_GITHUB_TOKEN }} + + - name: Remove old Homebrew formula + env: + GH_TOKEN: ${{ secrets.REPOSITORY_FULL_ACCESS_GITHUB_TOKEN }} + run: | + gh api \ + --method DELETE \ + -H "Accept: application/vnd.github+json" \ + repos/${{ github.repository }}/contents/Formula/dash0.rb \ + -f message="chore: remove old Homebrew formula in favor of Cask" \ + -f sha="$(gh api repos/${{ github.repository }}/contents/Formula/dash0.rb --jq .sha)" \ + 2>/dev/null || echo "Formula/dash0.rb already removed, skipping." diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6fc9d19..2f6171b 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -96,7 +96,7 @@ docker_signs: - "${artifact}" - "--yes" -brews: +homebrew_casks: - name: dash0 repository: owner: dash0hq @@ -104,11 +104,18 @@ brews: commit_author: name: github-actions[bot] email: github-actions[bot]@users.noreply.github.com - commit_msg_template: "chore: brew formula update for {{ .ProjectName }} version {{ .Tag }}" - directory: Formula + commit_msg_template: "chore: brew cask update for {{ .ProjectName }} version {{ .Tag }}" + directory: Casks homepage: https://github.com/dash0hq/dash0-cli description: CLI to interact with Dash0 - extra_install: | - bash_completion.install "completions/dash0.bash" => "dash0" - zsh_completion.install "completions/dash0.zsh" => "_dash0" - fish_completion.install "completions/dash0.fish" => "dash0.fish" + binaries: + - dash0 + completions: + bash: completions/dash0.bash + zsh: completions/dash0.zsh + fish: completions/dash0.fish + hooks: + post: + install: | + system_command "/usr/bin/xattr", + args: ["-dr", "com.apple.quarantine", "#{staged_path}/dash0"] diff --git a/README.md b/README.md index 32529c8..be68b21 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,13 @@ Interactive prompts can be skipped with `--force`. ```bash brew tap dash0hq/dash0-cli https://github.com/dash0hq/dash0-cli -brew install dash0hq/dash0-cli/dash0 +brew install --cask dash0hq/dash0-cli/dash0 ``` +> [!NOTE] +> The `dash0` CLI was previously distributed as a Homebrew Formula. +> If you installed it via `brew install dash0hq/dash0-cli/dash0`, run `brew update` to migrate to the Cask automatically. + ### GitHub Releases Download pre-built binaries for your platform from the [releases page](https://github.com/dash0hq/dash0-cli/releases). diff --git a/tap_migrations.json b/tap_migrations.json new file mode 100644 index 0000000..ebbb637 --- /dev/null +++ b/tap_migrations.json @@ -0,0 +1,3 @@ +{ + "dash0": "cask/dash0" +}