-
Notifications
You must be signed in to change notification settings - Fork 14
46 lines (37 loc) · 1.4 KB
/
publish-client-maven-central.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
echo "SIGNING_SECRET_KEY_RING_FILE=$(pwd)/private-key.asc" >> $GITHUB_ENV
- 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 }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
working-directory: ./src/AndroidClient
run: ./gradlew client:publishAllPublicationsToOSSRHRepository -Psigning.keyId=${{ secrets.SIGNING_KEY_ID }} -Psigning.secretKeyRingFile=${{ env.SIGNING_SECRET_KEY_RING_FILE }}