-
Notifications
You must be signed in to change notification settings - Fork 102
55 lines (50 loc) · 1.42 KB
/
ci.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
name: Java CI
env:
JDK_CURRENT: 17
DISTRIBUTION: zulu
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.DISTRIBUTION }}
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: mvn -B clean install
deploy:
if: startsWith(github.ref, 'refs/heads/')
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_CURRENT }}
distribution: ${{ env.DISTRIBUTION }}
server-id: sonatype-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy to Sonatype
run: mvn -B -DskipTests deploy
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USER }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PWD }}