Skip to content

Commit 3029d49

Browse files
committed
fix: replace arduino/setup-protoc@v1 with cross-platform protoc installation
The arduino/setup-protoc@v1 action contained x86_64-specific binaries that failed on ARM64 systems (Apple M1/M2, ARM64 Linux) when using the 'act' tool for local CI testing. Changes: - Replace arduino/setup-protoc@v1 with cross-platform shell script in all workflows - Auto-detect architecture (x86_64, aarch64, arm64) - Download appropriate protoc binary from official GitHub releases - Install to /usr/local/bin/protoc with proper includes - Upgrade to protoc v25.1 (latest stable) - Add comprehensive error handling and validation Files updated: - .github/workflows/ci-go-cover.yml - .github/workflows/ci.yml - .github/workflows/linters.yml - .github/workflows/time-package.yml This enables local CI testing on ARM64 systems while maintaining full backward compatibility with existing x86_64 runners. Fixes #60 Signed-off-by: Kallal Mukherjee <[email protected]>
1 parent b8cd07b commit 3029d49

File tree

4 files changed

+84
-16
lines changed

4 files changed

+84
-16
lines changed

.github/workflows/ci-go-cover.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,27 @@ jobs:
3939
run: |
4040
go install golang.org/x/tools/cmd/guru@latest
4141
- name: Install Protoc
42-
uses: arduino/setup-protoc@v1
43-
with:
44-
version: '3.x'
45-
repo-token: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
# Install protoc with ARM64 support
44+
PROTOC_VERSION="25.1"
45+
ARCH=$(uname -m)
46+
if [[ "$ARCH" == "x86_64" ]]; then
47+
PROTOC_ARCH="x86_64"
48+
elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
49+
PROTOC_ARCH="aarch_64"
50+
else
51+
echo "Unsupported architecture: $ARCH"
52+
exit 1
53+
fi
54+
55+
PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
56+
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"
57+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local bin/protoc
58+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local 'include/*'
59+
rm -f "$PROTOC_ZIP"
60+
61+
# Verify installation
62+
protoc --version
4663
- name: protoc-gen deps
4764
run: |
4865
go install google.golang.org/protobuf/cmd/[email protected]

.github/workflows/ci.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,27 @@ jobs:
2525
run: |
2626
go install golang.org/x/tools/cmd/guru@latest
2727
- name: Install Protoc
28-
uses: arduino/setup-protoc@v1
29-
with:
30-
version: '3.x'
31-
repo-token: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
# Install protoc with ARM64 support
30+
PROTOC_VERSION="25.1"
31+
ARCH=$(uname -m)
32+
if [[ "$ARCH" == "x86_64" ]]; then
33+
PROTOC_ARCH="x86_64"
34+
elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
35+
PROTOC_ARCH="aarch_64"
36+
else
37+
echo "Unsupported architecture: $ARCH"
38+
exit 1
39+
fi
40+
41+
PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
42+
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"
43+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local bin/protoc
44+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local 'include/*'
45+
rm -f "$PROTOC_ZIP"
46+
47+
# Verify installation
48+
protoc --version
3249
- name: protoc-gen deps
3350
run: |
3451
go install google.golang.org/protobuf/cmd/[email protected]

.github/workflows/linters.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,27 @@ jobs:
2626
run: |
2727
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
2828
- name: Install Protoc
29-
uses: arduino/setup-protoc@v1
30-
with:
31-
version: '3.x'
32-
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
# Install protoc with ARM64 support
31+
PROTOC_VERSION="25.1"
32+
ARCH=$(uname -m)
33+
if [[ "$ARCH" == "x86_64" ]]; then
34+
PROTOC_ARCH="x86_64"
35+
elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
36+
PROTOC_ARCH="aarch_64"
37+
else
38+
echo "Unsupported architecture: $ARCH"
39+
exit 1
40+
fi
41+
42+
PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
43+
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"
44+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local bin/protoc
45+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local 'include/*'
46+
rm -f "$PROTOC_ZIP"
47+
48+
# Verify installation
49+
protoc --version
3350
- name: protoc-gen deps
3451
run: |
3552
go install google.golang.org/protobuf/cmd/[email protected]

.github/workflows/time-package.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,27 @@ jobs:
3535
run: |
3636
go install golang.org/x/tools/cmd/guru@latest
3737
- name: Install Protoc
38-
uses: arduino/setup-protoc@v1
39-
with:
40-
version: '3.x'
41-
repo-token: ${{ secrets.GITHUB_TOKEN }}
38+
run: |
39+
# Install protoc with ARM64 support
40+
PROTOC_VERSION="25.1"
41+
ARCH=$(uname -m)
42+
if [[ "$ARCH" == "x86_64" ]]; then
43+
PROTOC_ARCH="x86_64"
44+
elif [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
45+
PROTOC_ARCH="aarch_64"
46+
else
47+
echo "Unsupported architecture: $ARCH"
48+
exit 1
49+
fi
50+
51+
PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip"
52+
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"
53+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local bin/protoc
54+
sudo unzip -o "$PROTOC_ZIP" -d /usr/local 'include/*'
55+
rm -f "$PROTOC_ZIP"
56+
57+
# Verify installation
58+
protoc --version
4259
- name: protoc-gen deps
4360
run: |
4461
go install google.golang.org/protobuf/cmd/[email protected]

0 commit comments

Comments
 (0)