@@ -10,7 +10,6 @@ concurrency:
1010permissions :
1111 contents : write
1212env :
13- # Hardcoded deadline - do not change unless intentionally extending support
1413 FORMULA_DEADLINE : " 2027-12-31"
1514jobs :
1615 update-homebrew :
@@ -32,15 +31,18 @@ jobs:
3231 GH_TOKEN : ${{ github.token }}
3332 run : |
3433 gh release download "${{ steps.version.outputs.TAG }}" --repo "${{ github.repository }}" --pattern "grpctestify-linux-amd64.tar.gz" --clobber
34+ gh release download "${{ steps.version.outputs.TAG }}" --repo "${{ github.repository }}" --pattern "grpctestify-linux-arm64.tar.gz" --clobber
3535 gh release download "${{ steps.version.outputs.TAG }}" --repo "${{ github.repository }}" --pattern "grpctestify-macos-arm64.tar.gz" --clobber
3636 gh release download "${{ steps.version.outputs.TAG }}" --repo "${{ github.repository }}" --pattern "grpctestify-macos-amd64.tar.gz" --clobber
3737 - name : Calculate checksums
3838 id : checksum
3939 run : |
4040 LINUX_AMD64_CHECKSUM=$(sha256sum grpctestify-linux-amd64.tar.gz | awk '{print $1}')
41+ LINUX_ARM64_CHECKSUM=$(sha256sum grpctestify-linux-arm64.tar.gz | awk '{print $1}')
4142 MACOS_ARM64_CHECKSUM=$(sha256sum grpctestify-macos-arm64.tar.gz | awk '{print $1}')
4243 MACOS_AMD64_CHECKSUM=$(sha256sum grpctestify-macos-amd64.tar.gz | awk '{print $1}')
4344 echo "LINUX_AMD64_CHECKSUM=$LINUX_AMD64_CHECKSUM" >> $GITHUB_OUTPUT
45+ echo "LINUX_ARM64_CHECKSUM=$LINUX_ARM64_CHECKSUM" >> $GITHUB_OUTPUT
4446 echo "MACOS_ARM64_CHECKSUM=$MACOS_ARM64_CHECKSUM" >> $GITHUB_OUTPUT
4547 echo "MACOS_AMD64_CHECKSUM=$MACOS_AMD64_CHECKSUM" >> $GITHUB_OUTPUT
4648 - name : Clone tap repo
@@ -53,61 +55,128 @@ jobs:
5355 run : |
5456 VERSION="${{ steps.version.outputs.VERSION }}"
5557 LINUX_AMD64_CHECKSUM="${{ steps.checksum.outputs.LINUX_AMD64_CHECKSUM }}"
58+ LINUX_ARM64_CHECKSUM="${{ steps.checksum.outputs.LINUX_ARM64_CHECKSUM }}"
5659 MACOS_ARM64_CHECKSUM="${{ steps.checksum.outputs.MACOS_ARM64_CHECKSUM }}"
5760 MACOS_AMD64_CHECKSUM="${{ steps.checksum.outputs.MACOS_AMD64_CHECKSUM }}"
5861 DEADLINE="${{ env.FORMULA_DEADLINE }}"
5962
6063 cat > homebrew-tap/Formula/grpctestify.rb << EOF
61- # DEADLINE: ${DEADLINE} - Please migrate to cask
62- # brew install --cask grpctestify
63- #
64- # This formula is deprecated and will be removed after ${DEADLINE}
64+ # typed: false
65+ # frozen_string_literal: true
6566
67+ # This file was generated by GitHub Actions. DO NOT EDIT.
6668 class Grpctestify < Formula
67- desc "gRPC testing utility written in Rust (deprecated - use cask) "
69+ desc "gRPC testing utility written in Rust"
6870 homepage "https://github.com/gripmock/grpctestify-rust"
69- url "https://github.com/gripmock/grpctestify-rust/releases/download/v${VERSION}/grpctestify-linux-amd64.tar.gz"
70- sha256 "${LINUX_AMD64_CHECKSUM}"
7171 version "${VERSION}"
7272 license "MIT"
73- deprecated! date: "${DEADLINE}", because: "use cask instead"
7473
75- def install
76- bin.install "grpctestify"
74+ on_macos do
75+ if Hardware::CPU.intel?
76+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v${VERSION}/grpctestify-macos-amd64.tar.gz"
77+ sha256 "${MACOS_AMD64_CHECKSUM}"
78+
79+ def install
80+ bin.install "grpctestify"
81+ end
82+ end
83+
84+ if Hardware::CPU.arm?
85+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v${VERSION}/grpctestify-macos-arm64.tar.gz"
86+ sha256 "${MACOS_ARM64_CHECKSUM}"
87+
88+ def install
89+ bin.install "grpctestify"
90+ end
91+ end
92+ end
93+
94+ on_linux do
95+ if Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
96+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v${VERSION}/grpctestify-linux-amd64.tar.gz"
97+ sha256 "${LINUX_AMD64_CHECKSUM}"
98+
99+ def install
100+ bin.install "grpctestify"
101+ end
102+ end
103+
104+ if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
105+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v${VERSION}/grpctestify-linux-arm64.tar.gz"
106+ sha256 "${LINUX_ARM64_CHECKSUM}"
107+
108+ def install
109+ bin.install "grpctestify"
110+ end
111+ end
112+ end
113+
114+ deprecate! date: "${DEADLINE}", because: "moved to cask. Please run `brew install --cask grpctestify`"
115+
116+ def caveats
117+ <<~EOS
118+ The 'grpctestify' formula is deprecated and will be removed in future versions.
119+ Please migrate to the cask version:
120+ brew uninstall grpctestify
121+ brew install --cask grpctestify
122+ EOS
77123 end
78124
79125 test do
80- assert_match "${VERSION }", shell_output("#{bin}/grpctestify --version")
126+ assert_match "#{version }", shell_output("#{bin}/grpctestify --version")
81127 end
82128 end
83129 EOF
84130
85131 cat > homebrew-tap/Casks/grpctestify.rb << EOF
132+ # This file was generated by GitHub Actions. DO NOT EDIT.
86133 cask "grpctestify" do
87- arch arm: "arm64", intel: "amd64"
88-
89- version "${VERSION}"
90- sha256 arm: "${MACOS_ARM64_CHECKSUM}", intel: "${MACOS_AMD64_CHECKSUM}"
91-
92- url "https://github.com/gripmock/grpctestify-rust/releases/download/v#{version}/grpctestify-macos-#{arch}.tar.gz"
93- name "gRPCTestify"
134+ name "grpctestify"
94135 desc "gRPC testing utility written in Rust"
95136 homepage "https://github.com/gripmock/grpctestify-rust"
137+ version "${VERSION}"
96138
97- binary "grpctestify", target: "grpctestify"
139+ livecheck do
140+ skip "Auto-generated on release."
141+ end
98142
99- postflight do
100- system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{HOMEBREW_PREFIX}/bin/grpctestify"], must_succeed: false
143+ binary "grpctestify"
144+
145+ on_macos do
146+ on_intel do
147+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v#{version}/grpctestify-macos-amd64.tar.gz",
148+ verified: "github.com/gripmock/grpctestify-rust"
149+ sha256 "${MACOS_AMD64_CHECKSUM}"
150+ end
151+
152+ on_arm do
153+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v#{version}/grpctestify-macos-arm64.tar.gz",
154+ verified: "github.com/gripmock/grpctestify-rust"
155+ sha256 "${MACOS_ARM64_CHECKSUM}"
156+ end
157+ end
158+
159+ on_linux do
160+ on_intel do
161+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v#{version}/grpctestify-linux-amd64.tar.gz",
162+ verified: "github.com/gripmock/grpctestify-rust"
163+ sha256 "${LINUX_AMD64_CHECKSUM}"
164+ end
165+
166+ on_arm do
167+ url "https://github.com/gripmock/grpctestify-rust/releases/download/v#{version}/grpctestify-linux-arm64.tar.gz",
168+ verified: "github.com/gripmock/grpctestify-rust"
169+ sha256 "${LINUX_ARM64_CHECKSUM}"
170+ end
101171 end
102172
103- caveats <<~EOS
104- If macOS still blocks launch, run:
105- xattr -dr com.apple.quarantine "$(brew --prefix)/bin/grpctestify"
106- EOS
173+ postflight do
174+ if OS.mac?
175+ system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/grpctestify"]
176+ end
177+ end
107178
108- zap trash: [
109- "~/.grpctestify",
110- ]
179+ # No zap stanza required
111180 end
112181 EOF
113182 - name : Commit tap updates
0 commit comments