Publish Android #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Android | |
on: | |
release: | |
types: | |
- created | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Write GPG Sec Ring | |
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg | |
- name: Update gradle.properties | |
run: echo -e "signing.secretKeyRingFile=/tmp/secring.gpg\nsigning.keyId=${{ secrets.SIGNING_KEY_ID }}\nsigning.password=${{ secrets.SIGNING_PASSWORD }}\nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}\nmavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties | |
- name: Upload Android Archives | |
run: ./gradlew assembleRelease publish --info | |
- name: Upload Java-Only Archives | |
run: ./gradlew -b host.gradle assemble publish --info | |
- name: Release and close | |
run: ./gradlew closeAndReleaseRepository | |
- name: Clean secrets | |
if: always() | |
run: rm /tmp/secring.gpg |