-
Notifications
You must be signed in to change notification settings - Fork 173
52 lines (48 loc) · 1.56 KB
/
branch.yaml
File metadata and controls
52 lines (48 loc) · 1.56 KB
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
name: Test and Deploy
on:
push:
branches:
- master
- main
- 2.[0-9]+
jobs:
test:
name: Java ${{ matrix.java }} Test
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 17, 21 ]
steps:
- uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
cache: 'maven'
java-version: ${{ matrix.java }}
distribution: 'temurin'
- run: |
./mvnw -ntp -B clean install -DskipTests
./mvnw -ntp -B verify
deploy:
runs-on: ubuntu-latest
name: Deploy
needs: test
steps:
- uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
cache: 'maven'
java-version: 11
distribution: 'temurin'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central
run: ./mvnw clean deploy -Drelease -DskipTests -B
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}