|
| 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 |
0 commit comments