-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (50 loc) · 1.31 KB
/
java.yml
File metadata and controls
54 lines (50 loc) · 1.31 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: java
on:
push:
branches:
- main
- release/*
pull_request:
merge_group:
release:
types:
- published
jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
cache-dependency-path: 'java/pom.xml'
- name: Build with Maven
run: cd java && mvn clean install -DskipTests
- name: Run Unit Tests
run: cd java && mvn test
publish:
runs-on: ubuntu-latest
if: ${{ github.event.release.tag_name }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Maven Central Repository
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
cache-dependency-path: 'java/pom.xml'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: cd java && mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }}