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'
52
59
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool buck2
53
60
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded
54
61
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
+
55
72
# Build AAR Package
56
73
mkdir aar-out
57
74
export BUILD_AAR_DIR=aar-out
61
78
62
79
shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"
63
80
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
+
64
87
upload-release-aar :
65
88
name : upload-release-aar
66
89
needs : build-aar
0 commit comments