|
11 | 11 | description: Upload the AAR to maven staging repository |
12 | 12 | required: false |
13 | 13 | type: boolean |
| 14 | + flavor: |
| 15 | + type: choice |
| 16 | + options: |
| 17 | + - "xnnpack" |
| 18 | + - "vulkan+xnnpack" |
14 | 19 | schedule: |
15 | 20 | - cron: 0 10 * * * |
16 | 21 |
|
|
49 | 54 | contents: read |
50 | 55 | with: |
51 | 56 | secrets-env: EXECUTORCH_MAVEN_SIGNING_KEYID EXECUTORCH_MAVEN_SIGNING_PASSWORD EXECUTORCH_MAVEN_CENTRAL_PASSWORD EXECUTORCH_MAVEN_CENTRAL_USERNAME EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS |
52 | | - runner: linux.2xlarge |
| 57 | + # As this job has access to Maven credential, run this on a fresh ephemeral runner |
| 58 | + runner: ephemeral.linux.2xlarge |
53 | 59 | docker-image: executorch-ubuntu-22.04-clang12-android |
54 | 60 | submodules: 'recursive' |
55 | 61 | ref: ${{ github.sha }} |
|
59 | 65 | script: | |
60 | 66 | set -eux |
61 | 67 |
|
| 68 | + # Use sccache for NDK compiler as well |
| 69 | + export CMAKE_CXX_COMPILER_LAUNCHER=sccache |
| 70 | + export CMAKE_C_COMPILER_LAUNCHER=sccache |
| 71 | +
|
62 | 72 | # The generic Linux job chooses to use base env, not the one setup by the image |
63 | 73 | CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]") |
64 | 74 | conda activate "${CONDA_ENV}" |
|
75 | 85 |
|
76 | 86 | echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg |
77 | 87 |
|
| 88 | + # Update the version name in build.gradle in case of maven publish |
| 89 | + VERSION="${{ inputs.version }}" |
| 90 | + if [ ! -z "$VERSION" ]; then |
| 91 | + sed -i "s/\(coordinates(\"org.pytorch\", \"executorch-android\", \"\)\([0-9]\+.[0-9]\+.[0-9]\+\)\(\")\)/\1$VERSION\3/" extension/android/executorch_android/build.gradle |
| 92 | + fi |
| 93 | +
|
| 94 | + FLAVOR="${{ inputs.flavor }}" |
| 95 | + if [[ "$FLAVOR" == "vulkan+xnnpack" ]]; then |
| 96 | + export EXECUTORCH_BUILD_VULKAN=ON |
| 97 | + fi |
| 98 | +
|
78 | 99 | # Build AAR Package |
79 | 100 | mkdir aar-out |
80 | 101 | export BUILD_AAR_DIR=aar-out |
|
87 | 108 | # Publish to maven staging |
88 | 109 | UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}" |
89 | 110 | if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then |
90 | | - (cd aar-out; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral) |
| 111 | + (cd extension/android; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral) |
91 | 112 | fi |
92 | 113 |
|
93 | 114 | upload-release-aar: |
|
0 commit comments