-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (32 loc) · 1.06 KB
/
central-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: Build and Publish to Sonatype
on:
push:
branches:
- main
pull_request: # test to be removed before merge
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Gradle
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "oracle"
- name: Import GPG key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
- name: Configure GPG passphrase
run: |
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --batch --yes --passphrase-fd 0 --pinentry-mode loopback --sign-key ${{ secrets.GPG_KEY_ID }}
- name: Publish to Sonatype
run: ./gradlew publish --no-daemon
- name: Clean up GPG keys
run: gpg --batch --yes --delete-secret-keys ${{ secrets.GPG_KEY_ID }}