Skip to content

Commit cb8c371

Browse files
committed
Update github deploy action
1 parent c123b33 commit cb8c371

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

.github/workflows/main.yml

+16-14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
branches:
55
- master
66
- "3.0"
7+
- "2.14"
78
- "2.13"
89
paths-ignore:
910
- "README.md"
@@ -12,6 +13,7 @@ on:
1213
branches:
1314
- master
1415
- "3.0"
16+
- "2.14"
1517
- "2.13"
1618
paths-ignore:
1719
- "README.md"
@@ -22,40 +24,40 @@ jobs:
2224
strategy:
2325
fail-fast: false
2426
matrix:
25-
java_version: ['8', '11']
27+
# JDK 17 has a few failures so cannot yet enable for this module
28+
java_version: ['8', '11', '17']
2629
os: ['ubuntu-20.04']
2730
env:
2831
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
2932
steps:
30-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v3
3134
- name: Set up JDK
32-
uses: actions/setup-java@v2
35+
uses: actions/setup-java@v3
3336
with:
34-
distribution: "adopt"
37+
distribution: 'temurin'
3538
java-version: ${{ matrix.java_version }}
39+
cache: 'maven'
3640
server-id: sonatype-nexus-snapshots
3741
server-username: CI_DEPLOY_USERNAME
3842
server-password: CI_DEPLOY_PASSWORD
3943
# See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven
4044
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
4145
# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
42-
- uses: actions/[email protected]
43-
with:
44-
path: ~/.m2/repository
45-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
46-
restore-keys: |
47-
${{ runner.os }}-maven-
4846
- name: Build
49-
run: ./mvnw -V -B -ff -ntp verify
47+
run: ./mvnw -B -q -ff -ntp verify
48+
- name: Extract project Maven version
49+
id: projectVersion
50+
run: echo ::set-output name=version::$(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -DforceStdout -Dexpression=project.version -q)
5051
- name: Deploy snapshot
51-
if: github.event_name != 'pull_request' && matrix.java_version == '8'
52+
if: github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT')
5253
env:
5354
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
5455
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
55-
run: ./mvnw -B -ff -DskipTests -ntp source:jar deploy
56+
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
57+
run: ./mvnw -B -q -ff -DskipTests -ntp source:jar deploy
5658
- name: Generate code coverage
5759
if: github.event_name != 'pull_request' && matrix.java_version == '8'
58-
run: ./mvnw -B -ff -ntp test
60+
run: ./mvnw -B -q -ff -ntp test
5961
- name: Publish code coverage
6062
if: github.event_name != 'pull_request' && matrix.java_version == '8'
6163
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)