Skip to content

[TEST ONLY] #9787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/android-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: Version name to be uploaded for AAR release
required: false
type: string
upload_to_maven:
description: Upload the AAR to maven staging repository
required: false
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -31,11 +35,14 @@ jobs:
build-aar:
name: build-aar
needs: check-if-aar-exists
if: ${{ !github.event.pull_request.head.repo.fork }}
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@release/2.7
secrets: inherit
permissions:
id-token: write
contents: read
with:
secrets-env: EXECUTORCH_MAVEN_SIGNING_KEYID EXECUTORCH_MAVEN_SIGNING_PASSWORD EXECUTORCH_MAVEN_CENTRAL_PASSWORD EXECUTORCH_MAVEN_CENTRAL_USERNAME EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably need line 46 and 48 from https://github.com/pytorch/executorch/blob/main/.github/workflows/apple.yml#L46-L48 too

    if: ${{ !github.event.pull_request.head.repo.fork }}
    secrets: inherit

runner: linux.2xlarge
docker-image: executorch-ubuntu-22.04-clang12-android
submodules: 'true'
Expand All @@ -52,6 +59,16 @@ jobs:
PYTHON_EXECUTABLE=python bash .ci/scripts/setup-linux.sh --build-tool buck2
export ARTIFACTS_DIR_NAME=artifacts-to-be-uploaded

mkdir -p ~/.gradle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if these secrets can be used after building the aar archive, or do they need to be set in gradle.properties before the build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

touch ~/.gradle/gradle.properties
echo "signing.keyId=${SECRET_EXECUTORCH_MAVEN_SIGNING_KEYID}" >> ~/.gradle/gradle.properties
echo "signing.password=${SECRET_EXECUTORCH_MAVEN_SIGNING_PASSWORD}" >> ~/.gradle/gradle.properties
echo "mavenCentralUsername=${SECRET_EXECUTORCH_MAVEN_CENTRAL_USERNAME}" >> ~/.gradle/gradle.properties
echo "mavenCentralPassword=${SECRET_EXECUTORCH_MAVEN_CENTRAL_PASSWORD}" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> ~/.gradle/gradle.properties

echo -n "$SECRET_EXECUTORCH_MAVEN_SIGNING_GPG_KEY_CONTENTS" | base64 -d > /tmp/secring.gpg

# Build AAR Package
mkdir aar-out
export BUILD_AAR_DIR=aar-out
Expand All @@ -61,6 +78,12 @@ jobs:

shasum -a 256 "${ARTIFACTS_DIR_NAME}/executorch.aar"

# Publish to maven staging
UPLOAD_TO_MAVEN="${{ inputs.upload_to_maven }}"
if [[ "$UPLOAD_TO_MAVEN" == "true" ]]; then
(cd aar-out; ANDROID_HOME="${ANDROID_SDK:-/opt/android/sdk}" ./gradlew :executorch_android:publishToMavenCentral)
fi

upload-release-aar:
name: upload-release-aar
needs: build-aar
Expand Down
2 changes: 1 addition & 1 deletion extension/android/executorch_android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()

coordinates("org.pytorch", "executorch-android", "0.5.0-SNAPSHOT")
coordinates("org.pytorch", "executorch-android", "0.7.0")

pom {
name = "ExecuTorch Android"
Expand Down
Loading