-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (32 loc) · 1.1 KB
/
publish.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
name: Publish to Maven Central Repository
on:
push:
branches: [ "main" ]
permissions:
contents: read
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_SECRET_KEY_RING_FILE: signing.gpg
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Import GPG Key
run: |
echo -n ${{ secrets.GPG_ENCODED_KEY }} | base64 --decode | gpg --batch --import
gpg --batch --pinentry-mode=loopback --yes --passphrase $SIGNING_PASSPHRASE --output $HOME/$SIGNING_SECRET_KEY_RING_FILE --export-secret-key $SIGNING_KEY_ID
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Prepare Gradle
uses: gradle/gradle-build-action@v2
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Publish to Sonatype Repository
run: gradle publishMavenCentralPublicationToSonatypeRepository