generated from seart-group/template-maven-dependency
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (74 loc) · 1.94 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
paths:
- 'src/**'
- 'pom.xml'
pull_request_target:
paths:
- 'src/**'
- 'pom.xml'
jobs:
lint:
name: Lint files with Checkstyle
runs-on: ubuntu-latest
steps:
- name: Checkout latest
uses: actions/checkout@v4
- name: Run CheckStyle
uses: nikitasavinov/checkstyle-action@master
with:
level: error
fail_on_error: true
workdir: ./src
checkstyle_config: ./checkstyle.xml
github_token: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test on ${{ matrix.name }}
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: Linux
- os: macos-latest
name: macOS
- os: windows-latest
name: Windows
steps:
- name: Checkout latest
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
cache: maven
- name: Run Tests
run: mvn --batch-mode --update-snapshots verify -"Dgpg.skip"
deploy:
name: Deploy Snapshot
needs: test
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout latest
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
cache: maven
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATEKEY }}
- name: Deploy Snapshot
run: mvn --batch-mode deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}