-
Notifications
You must be signed in to change notification settings - Fork 13
136 lines (105 loc) · 3.38 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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@v4
with:
distribution: zulu
java-version: 21
cache: maven
- name: Build with Maven
run: ./mvnw -B -V verify --no-transfer-progress
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v4
compatibility-checks:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11, 17, 21, 23, 24-ea]
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@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Test with Maven
run: ./mvnw -B -V test
compatibility-checks-java8-maven363:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8]
name: Java ${{ matrix.java }} Compatibility with Maven 3.6.3
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Load Maven 3.6.3
run: mvn -B -V org.apache.maven.plugins::maven-wrapper-plugin:3.3.2:wrapper -Dmaven=3.6.3 --no-transfer-progress
- name: Test with Maven
run: ./mvnw -B -V test
compatibility-checks-java21-maven400:
runs-on: ubuntu-latest
strategy:
matrix:
java: [21]
name: Java ${{ matrix.java }} Compatibility with Maven 4.0.0-beta-4
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: maven
- name: Load Maven 4.0.0-beta-4
run: mvn -B -V org.apache.maven.plugins::maven-wrapper-plugin:3.3.2:wrapper -Dmaven=4.0.0-beta-4 --no-transfer-progress
- name: Test with Maven
run: ./mvnw -B -V test
deploy:
name: Deploy to OSSRH
needs: [build, compatibility-checks]
if: github.event_name == 'push' && github.repository_owner == 'acegi'
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: maven
- name: Set up Java and Maven
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
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: ./mvnw -B -V -Possrh-deploy deploy --no-transfer-progress
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
MAVEN_USERNAME: ${{ secrets.nexus_username }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.nexus_password }}