-
Notifications
You must be signed in to change notification settings - Fork 227
38 lines (32 loc) · 1.17 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
37
38
name: Publish
on:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: "Set up JDK"
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '21'
- name: Set up GPG
run: echo -n "${GPG_PRIVATE_KEY}" | base64 --decode > ${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- name: "Gradle Build"
run: ./gradlew build -Pversion=${GITHUB_REF:10}
- name: "Gradle Publish"
run: |
./gradlew publishToSonatype -Pversion=${GITHUB_REF:10} \
-Psigning.keyId=${GPG_KEY_ID} \
-Psigning.password=${GPG_PASSPHRASE} \
-Psigning.secretKeyRingFile=${GITHUB_WORKSPACE}/${GPG_KEY_ID}.gpg
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}