ci: separate protoc install steps for Linux and macOS with correct URLs

This commit is contained in:
rustmailer
2025-07-18 12:29:06 +08:00
parent 3ca1385334
commit 58d64a6223
+17 -8
View File
@@ -36,23 +36,32 @@ jobs:
target: ${{ matrix.target }}
override: true
- name: Install protoc on Linux/macOS
if: runner.os != 'Windows'
- name: Install protoc on Linux
if: runner.os == 'Linux'
run: |
PROTOC_VERSION=21.12
OS=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${OS}-x86_64.zip
unzip protoc-${PROTOC_VERSION}-${OS}-x86_64.zip -d protoc
PROTOC_VERSION=31.1
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/
protoc --version
- name: Install protoc on macOS
if: runner.os == 'macOS'
run: |
PROTOC_VERSION=31.1
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-osx-x86_64.zip
unzip protoc-${PROTOC_VERSION}-osx-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/
protoc --version
- name: Install protoc on Windows
if: runner.os == 'Windows'
run: |
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-win64.zip -OutFile protoc.zip
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/releases/download/v31.1/protoc-31.1-win64.zip -OutFile protoc.zip
Expand-Archive protoc.zip -DestinationPath protoc
$Env:PATH += ";${PWD}/protoc/bin"
protoc --version
- name: Setup Node.js & pnpm
uses: actions/setup-node@v4
with: