From 1bd11bba2cd6d9c9620d68891cdc9c9c7c28c87e Mon Sep 17 00:00:00 2001 From: Oliver Lazoroski Date: Fri, 10 Jul 2026 12:23:33 +0200 Subject: [PATCH] ci: install AWS CLI on self-hosted runner for S3 upload The S3 upload restored in #3725 fails on the self-hosted `public` runner because the AWS CLI is not installed there. Add a step that installs AWS CLI v2 when missing (no-op if already present), to a user-writable dir without sudo, and exposes it via GITHUB_PATH so the upload step can run. --- .github/workflows/sample-distribution.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/sample-distribution.yml b/.github/workflows/sample-distribution.yml index d6179e2793..363f9efd8e 100644 --- a/.github/workflows/sample-distribution.yml +++ b/.github/workflows/sample-distribution.yml @@ -96,6 +96,26 @@ jobs: FIREBASE_CREDENTIALS_JSON: ${{ secrets.FIREBASE_CREDENTIALS_JSON }} # Publish the same APK to S3 for the public download link. Reuses the # artifact the Fastlane step above already built (app-build/), no rebuild. + - name: Ensure AWS CLI is available + if: github.ref == 'refs/heads/develop' + # The self-hosted `public` runner does not ship the AWS CLI. Install v2 + # only when missing, to a user-writable dir (no sudo), then expose it. + run: | + if command -v aws >/dev/null 2>&1; then + echo "AWS CLI already installed: $(aws --version)" + exit 0 + fi + echo "AWS CLI not found; installing v2..." + case "$(uname -m)" in + x86_64) zip="awscli-exe-linux-x86_64.zip" ;; + aarch64|arm64) zip="awscli-exe-linux-aarch64.zip" ;; + *) echo "Unsupported architecture: $(uname -m)"; exit 1 ;; + esac + curl -fsSL "https://awscli.amazonaws.com/${zip}" -o /tmp/awscliv2.zip + unzip -q /tmp/awscliv2.zip -d /tmp + /tmp/aws/install --bin-dir "$HOME/.local/bin" --install-dir "$HOME/.local/aws-cli" --update + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + "$HOME/.local/bin/aws" --version - name: Configure AWS credentials if: github.ref == 'refs/heads/develop' uses: aws-actions/configure-aws-credentials@v4