Skip to content

Stage client to Maven Central #14

Stage client to Maven Central

Stage client to Maven Central #14

name: Publish client to Maven Central
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Import GPG key
run: |
echo "${{ secrets.OSSRH_GPG }}" > private-key.asc
gpg --import --batch private-key.asc
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Set up permissions client
run: chmod +x ./src/AndroidClient/gradlew
- name: Build client
working-directory: ./src/AndroidClient
run: ./gradlew client:build
- name: Publish to Maven Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_KEY }}
working-directory: ./src/AndroidClient
run: ./gradlew client:publishAllPublicationsToOSSRHRepository