7
7
description : Version name to be uploaded for AAR release
8
8
required : false
9
9
type : string
10
+ upload_to_maven :
11
+ description : Upload the AAR to maven staging repository
12
+ required : false
13
+ type : boolean
10
14
11
15
concurrency :
12
16
group : ${{ github.workflow }}-${{ github.ref }}
@@ -31,11 +35,14 @@ jobs:
31
35
build-aar :
32
36
name : build-aar
33
37
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
35
41
permissions :
36
42
id-token : write
37
43
contents : read
38
44
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
39
46
runner : linux.2xlarge
40
47
docker-image : executorch-ubuntu-22.04-clang12-android
41
48
submodules : ' true'
56
63
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool buck2
57
64
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
58
65
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
+
59
76
# Build AAR Package
60
77
mkdir aar-out
61
78
export BUILD_AAR_DIR=aar-out
65
82
66
83
shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
67
84
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
+
68
91
upload-release-aar :
69
92
name : upload-release-aar
70
93
needs : build-aar
0 commit comments