Skip to content

Commit c78873c

Browse files
committed
Add bufstream
1 parent eab55d4 commit c78873c

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Create Buf Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
type: string
7+
description: The version of bufstream you intend to release (eg x.y.z)
8+
env:
9+
VERSION: ${{ github.event.inputs.version }}
10+
jobs:
11+
update-formula:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout tap
15+
uses: actions/checkout@v4
16+
with:
17+
path: base
18+
- name: Update formula
19+
run: |
20+
# Darwin arm64
21+
curl -LO https://buf.build/dl/bufstream/v${VERSION}/bufstream-v${VERSION}-Darwin-arm64
22+
SHA256=$(shasum -a 256 bufstream-${VERSION}-Darwin-arm64 | awk '{print $1}')
23+
sed -i "s/version \".*\"/version \"$VERSION\"/" base/Formula/bufstream.rb
24+
sed -i "s/sha256 \".*\"/sha256 \"$SHA256\"/" base/Formula/bufstream.rb
25+
sed -i "s/\"darwin-arm64\" => \".*\"/\"darwin-arm64\" => \"$SHA256\"/" base/Formula/bufstream.rb
26+
# Darwin x86_64
27+
curl -LO https://buf.build/dl/bufstream/v${VERSION}/bufstream-v${VERSION}-Darwin-x86_64
28+
SHA256=$(shasum -a 256 bufstream-${VERSION}-Darwin-x86_64 | awk '{print $1}')
29+
sed -i "s/\"darwin-x86_64\" => \".*\"/\"darwin-x86_64\" => \"$SHA256\"/" base/Formula/bufstream.rb
30+
# Linux arm64
31+
curl -LO https://buf.build/dl/bufstream/v${VERSION}/bufstream-v${VERSION}-Linux-aarch64
32+
SHA256=$(shasum -a 256 bufstream-${VERSION}-Linux-aarch64 | awk '{print $1}')
33+
sed -i "s/\"linux-arm64\" => \".*\"/\"linux-arm64\" => \"$SHA256\"/" base/Formula/bufstream.rb
34+
# Linux x86_64
35+
curl -LO https://buf.build/dl/bufstream/v${VERSION}/bufstream-v${VERSION}-Linux-x86_64
36+
SHA256=$(shasum -a 256 bufstream-${VERSION}-Linux-x86_64 | awk '{print $1}')
37+
sed -i "s/\"linux-x86_64\" => \".*\"/\"linux-x86_64\" => \"$SHA256\"/" base/Formula/bufstream.rb
38+
- name: Create PR
39+
uses: peter-evans/create-pull-request@v7
40+
with:
41+
commit-message: Update bufstream to v${{ github.event.inputs.version }}
42+
title: Update bufstream to v${{ github.event.inputs.version }}
43+
body: |
44+
Update bufstream to v${{ github.event.inputs.version }}
45+
branch: update-bufstream-${{ github.event.inputs.version }}
46+
path: base

Formula/bufstream.rb

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
class Bufstream < Formula
2+
desc "Drop-in replacement for Apache Kafka with improved data quality and lower costs"
3+
homepage "https://buf.build/product/bufstream"
4+
version "0.3.11"
5+
url "https://buf.build/dl/bufstream/v#{version}/bufstream-v#{version}-Darwin-arm64" # Default URL for stable bottle generation
6+
sha256 "TODO" # Default SHA for the above URL
7+
8+
checksums = {
9+
"darwin-arm64" => "TODO",
10+
"darwin-x86_64" => "TODO",
11+
"linux-arm64" => "TODO",
12+
"linux-x86_64" => "TODO",
13+
}
14+
15+
on_macos do
16+
on_intel do
17+
url "https://buf.build/dl/bufstream/v#{version}/bufstream-v#{version}-Darwin-x86_64"
18+
sha256 checksums["darwin-x86_64"]
19+
end
20+
on_arm do
21+
url "https://buf.build/dl/bufstream/v#{version}/bufstream-v#{version}-Darwin-arm64"
22+
sha256 checksums["darwin-arm64"]
23+
end
24+
end
25+
26+
on_linux do
27+
on_intel do
28+
url "https://buf.build/dl/bufstream/v#{version}/bufstream-v#{version}-Linux-x86_64"
29+
sha256 checksums["linux-x86_64"]
30+
end
31+
on_arm do
32+
url "https://buf.build/dl/bufstream/v#{version}/bufstream-v#{version}-Linux-aarch64"
33+
sha256 checksums["linux-arm64"]
34+
end
35+
end
36+
37+
def install
38+
bin.install "bufstream-v#{version}-#{OS.kernel_name}-#{Hardware::CPU.arch}" => "bufstream"
39+
end
40+
41+
test do
42+
system "#{bin}/bufstream", "--version"
43+
end
44+
end

0 commit comments

Comments
 (0)