-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (34 loc) · 1.22 KB
/
publish.yaml
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
name: Publish to Maven Central
on:
workflow_dispatch:
release:
types: [created]
jobs:
publish:
name: Publish Release Artifacts
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- name: Set up Java 17 JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
architecture: x64
cache: 'gradle'
check-latest: true
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Decode GPG Key
run: |
mkdir -p ~/.gradle/
echo "${{secrets.OSSRH_GPG_SECRET_KEY}}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
- name: Publish package
run: ./gradlew publish -Psigning.keyId=${{secrets.OSSRH_GPG_SECRET_KEY_ID}} -Psigning.password=${{secrets.OSSRH_GPG_SECRET_KEY_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) --warn --stacktrace
env:
OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}
OSSRH_TOKEN_PASSWORD: ${{secrets.OSSRH_TOKEN_PASSWORD}}