This repository was archived by the owner on Mar 8, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (75 loc) · 3.15 KB
/
release.yml
File metadata and controls
88 lines (75 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Release and Update Homebrew Formula
on:
release:
types: [published]
permissions:
contents: write
packages: write
jobs:
release-and-homebrew:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
- name: Install bashly
run: |
gem install bashly
- name: Generate grpctestify.sh
run: |
make generate
- name: Generate checksums
id: checksum
run: |
CHECKSUM=$(sha256sum grpctestify.sh | awk '{print $1}')
echo "SHA256=$CHECKSUM" >> $GITHUB_ENV
echo "$(sha256sum grpctestify.sh | awk '{print $1}') grpctestify.sh" > checksums.txt
- name: Upload release assets
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
checksums.txt
grpctestify.sh
tag_name: ${{ github.event.release.tag_name }}
- name: Generate Homebrew formula
run: |
VERSION="${{ github.ref_name }}"
CHECKSUM="${{ env.SHA256 }}"
echo "# Formula for Grpctestify was automatically generated via GitHub Actions from:" > /tmp/grpctestify.rb
echo "# https://github.com/gripmock/grpctestify " >> /tmp/grpctestify.rb
echo "" >> /tmp/grpctestify.rb
echo "class Grpctestify < Formula" >> /tmp/grpctestify.rb
echo " desc \"Utility for testing gRPC servers\"" >> /tmp/grpctestify.rb
echo " homepage \"https://github.com/gripmock/grpctestify\"" >> /tmp/grpctestify.rb
echo " url \"https://github.com/gripmock/grpctestify/releases/download/${VERSION}/grpctestify.sh\"" >> /tmp/grpctestify.rb
echo " sha256 \"${CHECKSUM}\"" >> /tmp/grpctestify.rb
echo "" >> /tmp/grpctestify.rb
echo " depends_on \"grpcurl\"" >> /tmp/grpctestify.rb
echo " depends_on \"jq\"" >> /tmp/grpctestify.rb
echo "" >> /tmp/grpctestify.rb
echo " def install" >> /tmp/grpctestify.rb
echo " bin.install \"grpctestify.sh\" => \"grpctestify\"" >> /tmp/grpctestify.rb
echo " end" >> /tmp/grpctestify.rb
echo "" >> /tmp/grpctestify.rb
echo " test do" >> /tmp/grpctestify.rb
echo " assert_match \"${VERSION}\", shell_output(\"#{bin}/grpctestify --version\")" >> /tmp/grpctestify.rb
echo " end" >> /tmp/grpctestify.rb
echo "end" >> /tmp/grpctestify.rb
- name: Clone homebrew-tap repository
run: |
git clone https://${{ github.actor }}:${{ secrets.HOMEBREW_TOKEN }}@github.com/gripmock/homebrew-tap.git
cd homebrew-tap
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Update formula in homebrew-tap
run: |
cp /tmp/grpctestify.rb homebrew-tap/Formula/grpctestify.rb
cd homebrew-tap
git add Formula/grpctestify.rb
git commit -m "Update grpctestify to ${{ github.ref_name }}"
git push origin master