This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (52 loc) · 2 KB
/
build.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
name: Build / CI / Deploy Snapshots
on:
push:
branches: [ master ]
tags:
- '!refs/tags/*'
paths-ignore:
- '**/README.md'
- '**/.github/**'
pull_request:
branches: [ master ]
paths-ignore:
- '**/README.md'
- '**/.github/**'
jobs:
build-project:
name: 'Build'
runs-on: ubuntu-20.04
strategy:
matrix:
java: [ '11' ]
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
check-latest: true
- name: Build Java Project
run: mvn install -P'release' -Dgpg.skip=true -Dlicense.skipUpdateLicense=true -DskipTests=true -Dmaven.javadoc.skip=true -B -V --file pom.xml
- name: Unit Tests
run: mvn test
- name: Integration Tests
run: mvn verify
- name: Set up for Sonatype
uses: actions/setup-java@v2
with: # running setup-java again overwrites the settings.xml
distribution: 'adopt'
java-version: '11'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: SONATYPE_USERNAME # env variable for username in deploy
server-password: SONATYPE_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.GPG_AUTHOR_PRIVATEKEY }} # Value of the GPG private key to import
gpg-passphrase: GPG_AUTHOR_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Sonatype (Snapshots)
if: github.event_name != 'pull_request' && github.event_name != 'release'
run: mvn --batch-mode deploy -P'deploy-sonatype' -DskipTests=true -Dlicense.skipUpdateLicense=true -Dmaven.javadoc.skip=true
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_AUTHOR_PASSPHRASE: ${{ secrets.GPG_AUTHOR_PASSPHRASE }}