Skip to content

Commit b3963e6

Browse files
authored
Automatically update version name for maven upload (#10290)
Update the version field in build.gradle.
1 parent 08c07fa commit b3963e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/android-release-artifacts.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ jobs:
8080
8181
echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg
8282
83+
# Update the version name in build.gradle in case of maven publish
84+
VERSION="${{ inputs.version }}"
85+
if [ ! -z "$VERSION" ]; then
86+
sed -i "s/\(coordinates(\"org.pytorch\", \"executorch-android\", \"\)\([0-9]\+.[0-9]\+.[0-9]\+\)\(\")\)/\1$VERSION\3/" extension/android/executorch_android/build.gradle
87+
fi
88+
8389
# Build AAR Package
8490
mkdir aar-out
8591
export BUILD_AAR_DIR=aar-out
@@ -92,7 +98,7 @@ jobs:
9298
# Publish to maven staging
9399
UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
94100
if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then
95-
(cd aar-out; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
101+
(cd extension/android; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
96102
fi
97103
98104
upload-release-aar:

0 commit comments

Comments
 (0)