-
Notifications
You must be signed in to change notification settings - Fork 28
54 lines (51 loc) · 1.53 KB
/
master-snapshot-release.yml
File metadata and controls
54 lines (51 loc) · 1.53 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
52
53
54
name: Test & Release Snapshot to Maven Central
env:
MAVEN_ARGS: -V -ntp -e
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17 ]
distribution: [ temurin ]
steps:
- uses: actions/checkout@v6
- name: Set up Java and Maven
uses: actions/setup-java@v5
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Run unit tests
run: ./mvnw ${MAVEN_ARGS} -B test --file pom.xml
- name: Run integration tests
run: ./mvnw ${MAVEN_ARGS} -B package --file pom.xml
release-snapshot:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v6
- name: Set up Java and Maven
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
cache: 'maven'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Apache Maven Central
run: mvn package deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}