This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 88197364c ci: Remove setup-protoc entirely (#6994)
88197364c is described below
commit 88197364c11b26dc12aaf83af66cf6e1b9cddc7d
Author: Xuanwo <[email protected]>
AuthorDate: Sat Dec 13 00:52:02 2025 +0800
ci: Remove setup-protoc entirely (#6994)
* ci: Remove setup-protoc entirely
Signed-off-by: Xuanwo <[email protected]>
* Try fix
Signed-off-by: Xuanwo <[email protected]>
---------
Signed-off-by: Xuanwo <[email protected]>
---
.github/actions/setup/action.yaml | 82 +++++++++++++++++++++++++++++++++++---
.github/workflows/release_java.yml | 8 ++--
2 files changed, 81 insertions(+), 9 deletions(-)
diff --git a/.github/actions/setup/action.yaml
b/.github/actions/setup/action.yaml
index 2ee2c2d16..764d2b0af 100644
--- a/.github/actions/setup/action.yaml
+++ b/.github/actions/setup/action.yaml
@@ -16,7 +16,7 @@
# under the License.
name: Setup Rust Builder
-description: 'Prepare Rust Build Environment'
+description: "Prepare Rust Build Environment"
inputs:
need-rocksdb:
description: "This setup needs rocksdb or not"
@@ -59,10 +59,83 @@ runs:
- name: Setup Protoc
if: inputs.need-protoc == 'true'
- uses: arduino/setup-protoc@v3
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ PROTOC_VERSION="23.4"
+ PROTOC_ROOT="${RUNNER_TEMP}/protoc/${PROTOC_VERSION}"
+
+ case "${RUNNER_OS}-${RUNNER_ARCH}" in
+ Linux-X64)
+ PROTOC_PLATFORM="linux-x86_64"
+ ;;
+ Linux-ARM64)
+ PROTOC_PLATFORM="linux-aarch_64"
+ ;;
+ macOS-X64)
+ PROTOC_PLATFORM="osx-x86_64"
+ ;;
+ macOS-ARM64)
+ PROTOC_PLATFORM="osx-aarch_64"
+ ;;
+ Windows-X64)
+ PROTOC_PLATFORM="win64"
+ ;;
+ *)
+ echo "Unsupported runner: ${RUNNER_OS}-${RUNNER_ARCH}" >&2
+ exit 1
+ ;;
+ esac
+
+ echo "PROTOC_VERSION=${PROTOC_VERSION}" >> "${GITHUB_ENV}"
+ echo "PROTOC_ROOT=${PROTOC_ROOT}" >> "${GITHUB_ENV}"
+ echo "PROTOC_PLATFORM=${PROTOC_PLATFORM}" >> "${GITHUB_ENV}"
+
+ - name: Cache Protoc
+ if: inputs.need-protoc == 'true'
+ id: cache-protoc
+ uses: actions/cache@v4
with:
- version: "23.4"
- repo-token: ${{ inputs.github-token }}
+ path: ${{ runner.temp }}/protoc/${{ env.PROTOC_VERSION }}
+ key: protoc-${{ env.PROTOC_VERSION }}-${{ runner.os }}-${{ runner.arch
}}
+
+ - name: Install Protoc (Unix)
+ if: inputs.need-protoc == 'true' && runner.os != 'Windows' &&
steps.cache-protoc.outputs.cache-hit != 'true'
+ shell: bash
+ run: |
+ set -euo pipefail
+
+ PROTOC_ZIP="protoc-${PROTOC_VERSION}-${PROTOC_PLATFORM}.zip"
+
PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"
+
+ mkdir -p "${PROTOC_ROOT}"
+ curl -fsSL -o "${RUNNER_TEMP}/${PROTOC_ZIP}" "${PROTOC_URL}"
+ unzip -q "${RUNNER_TEMP}/${PROTOC_ZIP}" -d "${PROTOC_ROOT}"
+
+ - name: Install Protoc (Windows)
+ if: inputs.need-protoc == 'true' && runner.os == 'Windows' &&
steps.cache-protoc.outputs.cache-hit != 'true'
+ shell: pwsh
+ run: |
+ $ErrorActionPreference = 'Stop'
+
+ $protocZip = "protoc-$env:PROTOC_VERSION-$env:PROTOC_PLATFORM.zip"
+ $protocUrl =
"https://github.com/protocolbuffers/protobuf/releases/download/v$env:PROTOC_VERSION/$protocZip"
+ $zipPath = Join-Path $env:RUNNER_TEMP $protocZip
+ $dest = $env:PROTOC_ROOT
+
+ New-Item -ItemType Directory -Force -Path $dest | Out-Null
+ Invoke-WebRequest -Uri $protocUrl -OutFile $zipPath
+ Expand-Archive -Path $zipPath -DestinationPath $dest -Force
+
+ - name: Add Protoc to PATH
+ if: inputs.need-protoc == 'true'
+ shell: bash
+ run: |
+ set -euo pipefail
+ echo "${PROTOC_ROOT}/bin" >> "${GITHUB_PATH}"
+ export PATH="${PROTOC_ROOT}/bin:${PATH}"
+ protoc --version
- name: Install cargo-nextest
if: inputs.need-nextest == 'true'
@@ -133,4 +206,3 @@ runs:
rm foundationdb-clients_7.1.17-1_amd64.deb
rm foundationdb-server_7.1.17-1_amd64.deb
-
diff --git a/.github/workflows/release_java.yml
b/.github/workflows/release_java.yml
index e4662eccc..c530d0fcb 100644
--- a/.github/workflows/release_java.yml
+++ b/.github/workflows/release_java.yml
@@ -66,11 +66,11 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- - name: Install Protoc
- uses: arduino/setup-protoc@v3
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
with:
- version: "23.4"
- repo-token: ${{ secrets.GITHUB_TOKEN }}
+ need-protoc: true
+ github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup linux for zigbuild
if: ${{ contains(matrix.os, 'ubuntu') }}