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