Skip to content

Commit d310a47

Browse files
committed
Merge remote-tracking branch 'origin/android-upload-artifact' into android-upload-artifact-2
2 parents f7e25e9 + 307a6e9 commit d310a47

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

.github/workflows/android.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@ on:
1717
- extension/android/**
1818
- extension/module/**
1919
workflow_dispatch:
20+
inputs:
21+
version:
22+
description: Version name to be uploaded for AAR release
23+
required: false
24+
type: string
2025

2126
concurrency:
2227
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
2328
cancel-in-progress: true
2429

2530
jobs:
26-
build-llm-demo:
27-
name: build-llm-demo
31+
build-aar:
32+
name: build-aar
2833
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
2934
with:
3035
runner: linux.2xlarge
@@ -46,9 +51,39 @@ jobs:
4651
# Build LLM Demo for Android
4752
bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}
4853
54+
shasum -a 256 "${ARTIFACTS_DIR_NAME}/llm_demo/executorch.aar"
55+
56+
upload-release-aar:
57+
name: upload-release-aar
58+
needs: build-aar
59+
if: ${{ startsWith(github.ref, 'refs/tags/android/release') }}
60+
runs-on: ubuntu-22.04
61+
timeout-minutes: 10
62+
permissions:
63+
id-token: write
64+
contents: read
65+
steps:
66+
- name: configure aws credentials
67+
uses: aws-actions/[email protected]
68+
with:
69+
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-android
70+
aws-region: us-east-1
71+
- name: Upload AAR to RC if ciflow/android/release tag is present
72+
shell: bash
73+
run: |
74+
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/executorch.aar
75+
shasum -a 256 executorch.aar > executorch.aar.sha256sums
76+
77+
pip install awscli==1.32.18
78+
AWS_CMD="aws s3 cp"
79+
VERSION="${{ inputs.version }}"
80+
VERSION_NAME="${VERSION:-temp_snapshot}"
81+
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar --acl public-read
82+
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar.sha256sums --acl public-read
83+
4984
# Running Android emulator directly on the runner and not using Docker
5085
run-emulator:
51-
needs: build-llm-demo
86+
needs: build-aar
5287
# NB: Use metal install for KVM support to run the emulator faster
5388
runs-on: linux.24xl.spr-metal
5489
env:

0 commit comments

Comments
 (0)