Skip to content

Commit d56b6ae

Browse files
committed
Update CI
1 parent 53ccabc commit d56b6ae

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ on:
1212
pull_request:
1313
branches:
1414
- master
15+
- "3.0"
1516
- "2.14"
17+
- "2.13"
1618
paths-ignore:
1719
- "README.md"
1820
- "release-notes/*"
@@ -22,38 +24,39 @@ jobs:
2224
strategy:
2325
fail-fast: false
2426
matrix:
25-
java_version: ['8', '11', '14']
27+
java_version: ['8', '11', '17']
2628
os: ['ubuntu-20.04']
2729
env:
2830
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
2931
steps:
30-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
3133
- name: Set up JDK
32-
uses: actions/setup-java@v2
34+
uses: actions/setup-java@v3
3335
with:
34-
distribution: "adopt"
36+
distribution: 'temurin'
3537
java-version: ${{ matrix.java_version }}
38+
cache: 'maven'
3639
server-id: sonatype-nexus-snapshots
3740
server-username: CI_DEPLOY_USERNAME
3841
server-password: CI_DEPLOY_PASSWORD
39-
- uses: actions/[email protected]
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
4545
- 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)
4750
- 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')
4952
env:
5053
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
5154
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
5255
# 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
5457
- name: Generate code coverage
5558
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
5760
- name: Publish code coverage
5861
if: github.event_name != 'pull_request' && matrix.java_version == '8'
5962
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)