12
12
pull_request :
13
13
branches :
14
14
- master
15
+ - " 3.0"
15
16
- " 2.14"
17
+ - " 2.13"
16
18
paths-ignore :
17
19
- " README.md"
18
20
- " release-notes/*"
@@ -22,38 +24,39 @@ jobs:
22
24
strategy :
23
25
fail-fast : false
24
26
matrix :
25
- java_version : ['8', '11', '14 ']
27
+ java_version : ['8', '11', '17 ']
26
28
os : ['ubuntu-20.04']
27
29
env :
28
30
JAVA_OPTS : " -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
29
31
steps :
30
- - uses : actions/checkout@v2
32
+ - uses : actions/checkout@v3
31
33
- name : Set up JDK
32
- uses : actions/setup-java@v2
34
+ uses : actions/setup-java@v3
33
35
with :
34
- distribution : " adopt "
36
+ distribution : ' temurin '
35
37
java-version : ${{ matrix.java_version }}
38
+ cache : ' maven'
36
39
server-id : sonatype-nexus-snapshots
37
40
server-username : CI_DEPLOY_USERNAME
38
41
server-password : CI_DEPLOY_PASSWORD
39
-
40
- with :
41
- path : ~/.m2/repository
42
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
43
- restore-keys : |
44
- ${{ runner.os }}-maven-
42
+ # See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven
43
+ # gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
44
+ # gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
45
45
- name : Build
46
- run : ./mvnw -V -B -ff -ntp verify
46
+ run : ./mvnw -B -q -ff -ntp verify
47
+ - name : Extract project Maven version
48
+ id : projectVersion
49
+ run : echo ::set-output name=version::$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -DforceStdout -Dexpression=project.version -q)
47
50
- name : Deploy snapshot
48
- if : github.event_name != 'pull_request' && matrix.java_version == '8'
51
+ if : github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT')
49
52
env :
50
53
CI_DEPLOY_USERNAME : ${{ secrets.CI_DEPLOY_USERNAME }}
51
54
CI_DEPLOY_PASSWORD : ${{ secrets.CI_DEPLOY_PASSWORD }}
52
55
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
53
- run : ./mvnw -V -B -ff -DskipTests -ntp source:jar deploy
56
+ run : ./mvnw -B -q -ff -DskipTests -ntp source:jar deploy
54
57
- name : Generate code coverage
55
58
if : github.event_name != 'pull_request' && matrix.java_version == '8'
56
- run : ./mvnw -B -ff -ntp test
59
+ run : ./mvnw -B -q - ff -ntp test
57
60
- name : Publish code coverage
58
61
if : github.event_name != 'pull_request' && matrix.java_version == '8'
59
62
uses : codecov/codecov-action@v1
0 commit comments