-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (44 loc) · 1.26 KB
/
build.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
43
44
45
46
47
name: Java CI
on:
push:
pull_request:
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
cache-dependency-path: '**/pom.xml'
- name: Maven Verify
run: mvn -B clean verify
publish:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
cache-dependency-path: '**/pom.xml'
server-id: 'ossrh'
server-username: OSSRH_USERNAME
server-password: OSSRH_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: OSSRH_GPG_PASSPHRASE
- name: Publish to Apache Maven Central
run: mvn clean deploy -P release
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}