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'
5663 PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool buck2
5764 export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
5865
66+ mkdir -p ~/.gradle
67+ touch ~/.gradle/gradle.properties
68+ echo "signing.keyId=${SECRET_EXECUTORCH_MAVEN_SIGNING_KEYID}" >> ~/.gradle/gradle.properties
69+ echo "signing.password=${SECRET_EXECUTORCH_MAVEN_SIGNING_PASSWORD}" >> ~/.gradle/gradle.properties
70+ echo "mavenCentralUsername=${SECRET_EXECUTORCH_MAVEN_CENTRAL_USERNAME}" >> ~/.gradle/gradle.properties
71+ echo "mavenCentralPassword=${SECRET_EXECUTORCH_MAVEN_CENTRAL_PASSWORD}" >> ~/.gradle/gradle.properties
72+ echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> ~/.gradle/gradle.properties
73+
74+ echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg
75+
5976 # Build AAR Package
6077 mkdir aar-out
6178 export BUILD_AAR_DIR=aar-out
6582
6683 shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
6784
85+ # Publish to maven staging
86+ UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
87+ if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then
88+ (cd aar-out; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
89+ fi
90+
6891 upload-release-aar :
6992 name : upload-release-aar
7093 needs : build-aar
0 commit comments