77 description : Version name to be uploaded for AAR release
88 required : false
99 type : string
10+ upload_to_maven :
11+ description : Upload the AAR to maven staging repository
12+ required : false
13+ type : boolean
1014
1115concurrency :
1216 group : ${{ github.workflow }}-${{ github.ref }}
@@ -31,11 +35,14 @@ jobs:
3135 build-aar :
3236 name : build-aar
3337 needs : check-if-aar-exists
34- uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
38+ if : ${{ !github.event.pull_request.head.repo.fork }}
39+ uses : pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.7
40+ secrets : inherit
3541 permissions :
3642 id-token : write
3743 contents : read
3844 with :
45+ secrets-env : EXECUTORCH_MAVEN_SIGNING_KEYID EXECUTORCH_MAVEN_SIGNING_PASSWORD EXECUTORCH_MAVEN_CENTRAL_PASSWORD EXECUTORCH_MAVEN_CENTRAL_USERNAME EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS
3946 runner : linux.2xlarge
4047 docker-image : executorch-ubuntu-22.04-clang12-android
4148 submodules : ' true'
5259 PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool buck2
5360 export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
5461
62+ mkdir -p ~/.gradle
63+ touch ~/.gradle/gradle.properties
64+ echo "signing.keyId=${SECRET_EXECUTORCH_MAVEN_SIGNING_KEYID}" >> ~/.gradle/gradle.properties
65+ echo "signing.password=${SECRET_EXECUTORCH_MAVEN_SIGNING_PASSWORD}" >> ~/.gradle/gradle.properties
66+ echo "mavenCentralUsername=${SECRET_EXECUTORCH_MAVEN_CENTRAL_USERNAME}" >> ~/.gradle/gradle.properties
67+ echo "mavenCentralPassword=${SECRET_EXECUTORCH_MAVEN_CENTRAL_PASSWORD}" >> ~/.gradle/gradle.properties
68+ echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> ~/.gradle/gradle.properties
69+
70+ echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg
71+
5572 # Build AAR Package
5673 mkdir aar-out
5774 export BUILD_AAR_DIR=aar-out
6178
6279 shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
6380
81+ # Publish to maven staging
82+ UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
83+ if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then
84+ (cd aar-out; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
85+ fi
86+
6487 upload-release-aar :
6588 name : upload-release-aar
6689 needs : build-aar
0 commit comments