Skip to content

Commit 25a1be8

Browse files
[Android] Add a workflow dispatch for uploading release artifact (#5708)
Add a workflow dispatch for uploading release artifact (#5606) Summary: Pull Request resolved: #5606 Reviewed By: huydhn Differential Revision: D63346406 Pulled By: kirklandsign fbshipit-source-id: 1682c0e7e4f5dea4419b18a158762a4630f2bdcb (cherry picked from commit 13869ec) Co-authored-by: Hansong Zhang <[email protected]>
1 parent c609f11 commit 25a1be8

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Android Release Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version name to be uploaded for AAR release
8+
required: false
9+
type: string
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-aar:
17+
name: build-aar
18+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
19+
with:
20+
runner: linux.2xlarge
21+
docker-image: executorch-ubuntu-22.04-clang12-android
22+
submodules: 'true'
23+
ref: ${{ github.sha }}
24+
timeout: 90
25+
upload-artifact: android-apps
26+
upload-artifact-to-s3: true
27+
script: |
28+
set -eux
29+
30+
# The generic Linux job chooses to use base env, not the one setup by the image
31+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
32+
conda activate "${CONDA_ENV}"
33+
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh buck2
34+
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
35+
36+
# Build LLM Demo for Android
37+
bash build/build_android_llm_demo.sh ${ARTIFACTS_DIR_NAME}
38+
39+
shasum -a 256 "${ARTIFACTS_DIR_NAME}/llm_demo/executorch.aar"
40+
41+
upload-release-aar:
42+
name: upload-release-aar
43+
needs: build-aar
44+
runs-on: ubuntu-22.04
45+
timeout-minutes: 10
46+
permissions:
47+
id-token: write
48+
contents: read
49+
steps:
50+
- name: configure aws credentials
51+
uses: aws-actions/[email protected]
52+
with:
53+
role-to-assume: arn:aws:iam::308535385114:role/gha_executorch_upload-frameworks-android
54+
aws-region: us-east-1
55+
- name: Upload AAR RC to AWS S3
56+
shell: bash
57+
run: |
58+
wget https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/executorch.aar
59+
shasum -a 256 executorch.aar > executorch.aar.sha256sums
60+
61+
pip install awscli==1.32.18
62+
AWS_CMD="aws s3 cp"
63+
VERSION="${{ inputs.version }}"
64+
VERSION_NAME="${VERSION:-temp_snapshot}"
65+
${AWS_CMD} executorch.aar s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar --acl public-read
66+
${AWS_CMD} executorch.aar.sha256sums s3://ossci-android/executorch/release/${VERSION_NAME}/executorch.aar.sha256sums --acl public-read

0 commit comments

Comments
 (0)