From 61dbaf60d3a07cd697f4f480b90ca274053b5fbf Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Thu, 16 Jul 2026 15:23:51 +0800 Subject: [PATCH] ci: install zip and aws CLI on self-hosted runners (#4897) --- .github/actions/setup/action.yml | 1 + .github/workflows/build.yml | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index b88b04827..0bf688ed2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -56,6 +56,7 @@ runs: libssl-dev \ ripgrep \ unzip \ + zip \ protobuf-compiler - name: Install protoc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50928b562..4e3f56c20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -583,9 +583,19 @@ jobs: exit 0 fi + # The self-hosted Linux runners do not ship the aws CLI (GitHub-hosted + # images did). Install it on demand so R2 uploads survive a fresh runner + # instead of hard-failing here. if ! command -v aws >/dev/null 2>&1; then - echo "❌ aws CLI not found on runner; cannot upload to R2" - exit 1 + echo "aws CLI not found on runner; installing..." + if command -v apt-get >/dev/null 2>&1; then + sudo apt-get update && sudo apt-get install -y awscli + elif command -v brew >/dev/null 2>&1; then + brew install awscli + else + echo "❌ aws CLI missing and no apt-get/brew to install it; cannot upload to R2" + exit 1 + fi fi export AWS_ACCESS_KEY_ID="$R2_ACCESS_KEY_ID"