Skip to content

Commit d292f6c

Browse files
committed
feat(brew): use .gz compressed artifacts and add post_install setup
Switch Homebrew formula to download .gz compressed binaries instead of raw binaries. This reduces download size by ~62% (e.g. linux-x64 from 103MB to 30MB). Homebrew auto-decompresses .gz URLs natively. Also add post_install hook that runs 'sentry cli setup --method brew --no-modify-path' to configure shell completions, agent skills, and record the installation method after install/upgrade.
1 parent 8e4166c commit d292f6c

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.craft.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ targets:
2121
tap: getsentry/tools
2222
formula: sentry
2323
path: Formula
24-
includeNames: '/^sentry-(darwin|linux)-(arm64|x64)$/'
24+
includeNames: '/^sentry-(darwin|linux)-(arm64|x64)\.gz$/'
2525
template: |
2626
class Sentry < Formula
2727
desc "Sentry command-line tool for error monitoring and debugging"
@@ -31,21 +31,21 @@ targets:
3131
3232
if OS.mac?
3333
if Hardware::CPU.arm?
34-
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64"
35-
sha256 "{{checksums.sentry-darwin-arm64}}"
34+
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-arm64.gz"
35+
sha256 "{{checksums.sentry-darwin-arm64__gz}}"
3636
elsif Hardware::CPU.intel?
37-
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64"
38-
sha256 "{{checksums.sentry-darwin-x64}}"
37+
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64.gz"
38+
sha256 "{{checksums.sentry-darwin-x64__gz}}"
3939
else
4040
raise "Unsupported macOS CPU architecture: #{Hardware::CPU.type}"
4141
end
4242
elsif OS.linux?
4343
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
44-
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64"
45-
sha256 "{{checksums.sentry-linux-arm64}}"
44+
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-arm64.gz"
45+
sha256 "{{checksums.sentry-linux-arm64__gz}}"
4646
elsif Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
47-
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64"
48-
sha256 "{{checksums.sentry-linux-x64}}"
47+
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64.gz"
48+
sha256 "{{checksums.sentry-linux-x64__gz}}"
4949
else
5050
raise "Unsupported Linux CPU architecture: #{Hardware::CPU.type} (only 64-bit arm and x86_64 are supported)"
5151
end
@@ -57,6 +57,10 @@ targets:
5757
bin.install Dir["sentry-*"].first => "sentry"
5858
end
5959
60+
def post_install
61+
system bin/"sentry", "cli", "setup", "--method", "brew", "--no-modify-path"
62+
end
63+
6064
test do
6165
assert_match version.to_s, shell_output("#{bin}/sentry --version").chomp
6266
end

0 commit comments

Comments
 (0)