9
9
pull_request :
10
10
branches :
11
11
- master
12
+ permissions :
13
+ contents : read
14
+
12
15
jobs :
13
16
build :
14
17
runs-on : ${{ matrix.os }}
@@ -21,37 +24,34 @@ jobs:
21
24
env :
22
25
JAVA_OPTS : " -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
23
26
steps :
24
- - uses : actions/checkout@v3
27
+ - uses : actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
25
28
- name : Set up JDK
26
- uses : actions/setup-java@v3
29
+ uses : actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
27
30
with :
28
31
distribution : ' temurin'
29
32
java-version : ${{ matrix.java_version }}
30
33
cache : ' maven'
31
34
server-id : sonatype-nexus-snapshots
32
35
server-username : CI_DEPLOY_USERNAME
33
36
server-password : CI_DEPLOY_PASSWORD
34
- # See https://github.com/actions/setup-java/blob/v2/docs/advanced-usage.md#Publishing-using-Apache-Maven
35
- # gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
36
- # gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
37
- - name : Build project
37
+ - name : Build
38
38
run : ./mvnw -B -q -ff -ntp verify
39
39
- name : Extract project Maven version
40
40
id : projectVersion
41
- run : echo ::set-output name= version:: $(./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0 :evaluate -DforceStdout -Dexpression=project.version -q)
41
+ run : echo " version= $(./mvnw org.apache.maven.plugins:maven-help-plugin:3.4.1 :evaluate -DforceStdout -Dexpression=project.version -q)" >> $GITHUB_OUTPUT
42
42
- name : Deploy snapshot
43
- if : github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT')
43
+ if : ${{ github.event_name != 'pull_request' && matrix.java_version == '8' && endsWith(steps.projectVersion.outputs.version, '-SNAPSHOT') }}
44
44
env :
45
45
CI_DEPLOY_USERNAME : ${{ secrets.CI_DEPLOY_USERNAME }}
46
46
CI_DEPLOY_PASSWORD : ${{ secrets.CI_DEPLOY_PASSWORD }}
47
47
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
48
48
run : ./mvnw -B -q -ff -DskipTests -ntp source:jar deploy
49
49
- name : Generate code coverage
50
- if : github.event_name != 'pull_request' && matrix.java_version == '8'
50
+ if : ${{ github.event_name != 'pull_request' && matrix.java_version == '8' }}
51
51
run : ./mvnw -B -q -ff -ntp test
52
52
- name : Publish code coverage
53
- if : github.event_name != 'pull_request' && matrix.java_version == '8'
54
- uses : codecov/codecov-action@v1
53
+ if : ${{ github.event_name != 'pull_request' && matrix.java_version == '8' }}
54
+ uses : codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
55
55
with :
56
56
token : ${{ secrets.CODECOV_TOKEN }}
57
57
file : ./target/site/jacoco/jacoco.xml
0 commit comments