diff --git a/.github/workflows/publish-android-release.yml b/.github/workflows/publish-android-release.yml index 05aee864..04a7f108 100644 --- a/.github/workflows/publish-android-release.yml +++ b/.github/workflows/publish-android-release.yml @@ -1,9 +1,9 @@ name: Publish Android Release on: - release: - types: - - created + push: + tags: + - * workflow_dispatch: jobs: @@ -17,13 +17,24 @@ jobs: - name: Setup uses: ./.github/actions/setup-android - - name: Publish and release - run: | - ./gradlew :yoga:assembleRelease publish --info - ./gradlew closeAndReleaseRepository + - name: Publish to Maven Local + run: ./gradlew publishToMavenLocal env: - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }} - ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_USE_SNAPSHOT: true + ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }} + ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }} + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v3 + with: + name: 'snapshot-artifacts' + path: '~/.m2/repository/' + + - name: Publish to the Snapshot Repository + run: ./gradlew publishToSonatype + env: + ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }} + ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }} + ORG_GRADLE_PROJECT_USE_SNAPSHOT: true diff --git a/android/build.gradle b/android/build.gradle index c142282e..57b37499 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -30,6 +30,7 @@ android { publishing { multipleVariants { withSourcesJar() + withJavadocJar() includeBuildTypeValues('debug', 'release') } } @@ -38,9 +39,3 @@ android { dependencies { api project(':yoga') } - -// We don't build Javadoc at this time as we can't disable "BUCK" files -// from mistakenly getting parsed as Java. -tasks.withType(Javadoc).all { - enabled = false -} diff --git a/java/build.gradle b/java/build.gradle index f97b566a..bfabbdbd 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -50,6 +50,7 @@ android { publishing { multipleVariants { withSourcesJar() + withJavadocJar() includeBuildTypeValues('debug', 'release') } }