From ea07fc24b59bec1d3901dce9746d201c9b49a625 Mon Sep 17 00:00:00 2001 From: Hansong Zhang <107070759+kirklandsign@users.noreply.github.com> Date: Thu, 25 Sep 2025 11:57:31 -0700 Subject: [PATCH] Support uploading different AAR to S3 (#14605) Now stage AAR upload to https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar so we can have multiple flavors. Example: https://github.com/pytorch/executorch/actions/runs/18017149226, https://github.com/pytorch/executorch/actions/runs/18017146445 (cherry picked from commit 79e9224a6b0c424f2cc8565343e10a273487f64e) --- .../workflows/android-release-artifacts.yml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/android-release-artifacts.yml b/.github/workflows/android-release-artifacts.yml index 1b746e37166..6c89aac2ef7 100644 --- a/.github/workflows/android-release-artifacts.yml +++ b/.github/workflows/android-release-artifacts.yml @@ -15,15 +15,11 @@ on: type: choice options: - "xnnpack" - - "vulkan+xnnpack" + - "vulkan" - "qnn" schedule: - cron: 0 10 * * * -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - jobs: check-if-aar-exists: name: check-if-aar-exists @@ -34,12 +30,13 @@ jobs: shell: bash run: | VERSION="${{ inputs.version }}" + FLAVOR="${{ inputs.flavor }}" if [ -z "$VERSION" ]; then echo "No version name specified. Will create a snapshot AAR" exit 0 fi - if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar" | grep "200 OK"; then - echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}/executorch.aar" + if curl -I "https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar" | grep "200 OK"; then + echo "AAR already exists at https://ossci-android.s3.amazonaws.com/executorch/release/${VERSION}-${FLAVOR}/executorch.aar" echo "Will skip build/upload" exit 1 fi @@ -93,7 +90,7 @@ jobs: fi FLAVOR="${{ inputs.flavor }}" - if [[ "$FLAVOR" == "vulkan+xnnpack" || -z "$FLAVOR" ]]; then + if [[ "$FLAVOR" == "vulkan" || -z "$FLAVOR" ]]; then curl -O https://sdk.lunarg.com/sdk/download/1.4.321.1/linux/vulkansdk-linux-x86_64-1.4.321.1.tar.xz tar xf vulkansdk-linux-x86_64-1.4.321.1.tar.xz -C /tmp export PATH="/tmp/1.4.321.1/x86_64/bin:$PATH" @@ -148,8 +145,12 @@ jobs: pip install awscli==1.32.18 AWS_CMD="aws s3 cp" VERSION="${{ inputs.version }}" + FLAVOR="${{ inputs.flavor }}" if [ -z "$VERSION" ]; then VERSION="snapshot-$(date +"%Y%m%d")" fi - ${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}/executorch.aar --acl public-read - ${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}/executorch.aar.sha256sums --acl public-read + if [ -z "$FLAVOR" ]; then + FLAVOR="xnnpack" + fi + ${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION}-${FLAVOR}/executorch.aar --acl public-read + ${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION}-${FLAVOR}/executorch.aar.sha256sums --acl public-read