-
Notifications
You must be signed in to change notification settings - Fork 13
84 lines (67 loc) · 2.07 KB
/
maven.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Maven Build and Deployment
on: [push, pull_request]
jobs:
build:
name: Java Latest LTS Build and Verify
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 21
cache: maven
- name: Build with Maven
run: mvn -B verify
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
compatibility-checks:
runs-on: ubuntu-latest
strategy:
matrix:
java: [7, 8, 11, 17, 21]
name: Java ${{ matrix.java }} Compatibility
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Test with Maven
run: mvn -B test
deploy:
name: Deploy to OSSRH
needs: [build, compatibility-checks]
if: github.event_name == 'push' && github.repository_owner == 'acegi' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
cache: maven
- name: Set up Java and Maven
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.gpg_private_key }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish Maven package
run: mvn -Possrh-deploy deploy
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
MAVEN_USERNAME: ${{ secrets.nexus_username }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.nexus_password }}