@@ -2,39 +2,34 @@ name: Java8+ with Maven
22
33on : [ push, pull_request ]
44
5+ env :
6+ MAVEN_ARGS : " -B -ntp"
7+
58jobs :
69 build-and-test-job :
710 if : github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/develop') || startsWith(github.ref, 'refs/tags/v')
811 strategy :
912 fail-fast : false
1013 matrix :
11- java : [ 8, 17 ]
12- os : [ ubuntu-latest, macOS-latest , windows-latest ]
14+ java : [ 17, 21 ]
15+ os : [ ubuntu-latest, macos-15-intel , windows-latest ]
1316
1417 name : JDK${{ matrix.java }} on ${{ matrix.os }}
1518 runs-on : ${{ matrix.os }}
1619
1720 steps :
18- - name : Checkout source code
19- uses : actions/checkout@v4
20- with :
21- submodules : true
22- fetch-depth : 0
23-
24- - name : Setup Java
25- uses : actions/setup-java@v4
21+ - name : Checkout and Setup Maven
22+ uses : s4u/setup-maven-action@v1.20.0
2623 with :
27- distribution : ' temurin'
24+ checkout-submodules : true
25+ checkout-fetch-depth : 0
2826 java-version : ${{ matrix.java }}
29- cache : ' maven'
3027
3128 - name : Pre-download dependencies with Maven
32- run : mvn -U -B -ntp dependency:go-offline
29+ run : mvn -U dependency:go-offline
3330
3431 - name : Build and (headless) test with Maven
35- uses : smithki/xvfb-action@v1.1.2
36- with :
37- run : mvn -U -B -ntp package
32+ run : ${{ runner.os == 'Linux' && 'xvfb-run' || '' }} mvn install
3833
3934 auto-merge-job :
4035 needs : build-and-test-job
4843
4944 steps :
5045 - name : Merge PR
51- run : gh pr merge --auto --rebase "$PR_URL"
46+ uses : nick-fields/retry@v4
47+ with :
48+ command : gh pr merge --auto --rebase "$PR_URL"
49+ max_attempts : 3
50+ timeout_minutes : 5
5251 env :
5352 PR_URL : ${{github.event.pull_request.html_url}}
5453 GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
@@ -58,36 +57,30 @@ jobs:
5857 if : startsWith(github.repository, 'nbbrd/') && startsWith(github.ref, 'refs/heads/develop')
5958 strategy :
6059 matrix :
61- java : [ 17 ]
60+ java : [ 21 ]
6261 os : [ ubuntu-latest ]
6362
6463 name : Snapshot on develop
6564 runs-on : ${{ matrix.os }}
6665
6766 steps :
68- - name : Checkout source code
69- uses : actions/checkout@v4
67+ - name : Checkout and Setup Maven
68+ uses : s4u/setup-maven-action@v1.20.0
7069 with :
71- submodules : true
72- fetch-depth : 0
73-
74- - name : Setup Java
75- uses : actions/setup-java@v4
76- with :
77- distribution : ' temurin'
70+ checkout-submodules : true
71+ checkout-fetch-depth : 0
7872 java-version : ${{ matrix.java }}
79- cache : ' maven'
8073
8174 - name : Deploy snapshot with Maven if settings defined
82- run : test ! -f ci.settings.xml || mvn -B -ntp deploy -DskipTests -s ci.settings.xml -P base-deploy,snapshot-deploy,!non-deployable-modules
75+ run : test ! -f ci.settings.xml || mvn deploy -DskipTests -s ci.settings.xml -P base-deploy,snapshot-deploy,!non-deployable-modules
8376 env :
84- OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
85- OSSRH_TOKEN : ${{ secrets.OSSRH_TOKEN }}
77+ CENTRAL_PORTAL_USERNAME : ${{ secrets.CENTRAL_PORTAL_USERNAME }}
78+ CENTRAL_PORTAL_TOKEN : ${{ secrets.CENTRAL_PORTAL_TOKEN }}
8679 SIGN_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
8780 SIGN_KEY_PASS : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
8881
8982 - name : Dryrun release assets with Maven
90- run : mvn -B -ntp install -DskipTests -P full-release -Djreleaser.output.directory=$PWD/out/jreleaser -Djreleaser.dry.run
83+ run : mvn install -DskipTests -P full-release -Djreleaser.output.directory=$PWD/out/jreleaser -Djreleaser.dry.run
9184 env :
9285 JRELEASER_GITHUB_TOKEN : ${{ secrets.JRELEASER_GITHUB_TOKEN }}
9386 JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.MAVEN_GPG_PUBLIC_KEY }}
9689
9790 - name : Upload JReleaser output
9891 if : always()
99- uses : actions/upload-artifact@v4
92+ uses : actions/upload-artifact@v7
10093 with :
10194 name : assets-snapshot-log
10295 path : |
@@ -108,38 +101,32 @@ jobs:
108101 if : startsWith(github.repository, 'nbbrd/') && startsWith(github.ref, 'refs/tags/v')
109102 strategy :
110103 matrix :
111- java : [ 17 ]
104+ java : [ 21 ]
112105 os : [ ubuntu-latest ]
113106
114107 name : Release on tag
115108 runs-on : ${{ matrix.os }}
116109
117110 steps :
118- - name : Checkout source code
119- uses : actions/checkout@v4
120- with :
121- submodules : true
122- fetch-depth : 0
123-
124- - name : Setup Java
125- uses : actions/setup-java@v4
111+ - name : Checkout and Setup Maven
112+ uses : s4u/setup-maven-action@v1.20.0
126113 with :
127- distribution : ' temurin'
114+ checkout-submodules : true
115+ checkout-fetch-depth : 0
128116 java-version : ${{ matrix.java }}
129- cache : ' maven'
130117
131118 - name : Deploy with Maven if settings defined
132- run : test ! -f ci.settings.xml || mvn -B -ntp deploy -DskipTests -s ci.settings.xml -P base-deploy,release-deploy,!non-deployable-modules
119+ run : test ! -f ci.settings.xml || mvn deploy -DskipTests -s ci.settings.xml -P base-deploy,release-deploy,!non-deployable-modules
133120 env :
134- OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
135- OSSRH_TOKEN : ${{ secrets.OSSRH_TOKEN }}
121+ CENTRAL_PORTAL_USERNAME : ${{ secrets.CENTRAL_PORTAL_USERNAME }}
122+ CENTRAL_PORTAL_TOKEN : ${{ secrets.CENTRAL_PORTAL_TOKEN }}
136123 SIGN_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
137124 SIGN_KEY_PASS : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
138125 # Fix https://issues.sonatype.org/browse/OSSRH-66257
139126 MAVEN_OPTS : " --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
140127
141128 - name : Release assets with Maven
142- run : mvn -B -ntp install -DskipTests -P full-release -Djreleaser.output.directory=$PWD/out/jreleaser
129+ run : mvn install -DskipTests -P full-release -Djreleaser.output.directory=$PWD/out/jreleaser
143130 env :
144131 JRELEASER_GITHUB_TOKEN : ${{ secrets.JRELEASER_GITHUB_TOKEN }}
145132 JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.MAVEN_GPG_PUBLIC_KEY }}
@@ -148,7 +135,7 @@ jobs:
148135
149136 - name : Upload JReleaser output
150137 if : always()
151- uses : actions/upload-artifact@v4
138+ uses : actions/upload-artifact@v7
152139 with :
153140 name : assets-release-log
154141 path : |
0 commit comments