-
Notifications
You must be signed in to change notification settings - Fork 18
68 lines (56 loc) · 2.06 KB
/
ci.yml
File metadata and controls
68 lines (56 loc) · 2.06 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI
on:
push:
branches:
- master
pull_request: {}
jobs:
build-test-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '24'
- name: Configure Maven settings
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "central",
"username": "${{ secrets.CENTRAL_SONATYPE_USERNAME }}",
"password": "${{ secrets.CENTRAL_SONATYPE_PASSWORD }}"
}]
- name: Import GPG key
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_TEST_PRIV_KEY }}
passphrase: ${{ secrets.GPG_TEST_PASSPHRASE }}
- name: Download dependencies
run: mvn --batch-mode dependency:go-offline
- name: Build
run: mvn --batch-mode clean compile
- name: Test
run: mvn --batch-mode test
- name: Package without gpg
if: github.event_name != 'push' || github.ref != 'refs/heads/master'
run: mvn --batch-mode package -Dmaven.test.skip=true -Dgpg.skip=true
- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: mvn --batch-mode deploy
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: java-runtime-${{ github.event_name }}-${{ github.event.number || github.sha }}
path: target/*.jar
retention-days: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 30 || 7 }}
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ github.event_name }}-${{ github.event.number || github.sha }}
path: target/surefire-reports/
retention-days: 7