@@ -4,6 +4,7 @@ on: [ push, pull_request ]
44
55jobs :
66 build-and-test-job :
7+ if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
78 strategy :
89 fail-fast : false
910 matrix :
@@ -21,13 +22,13 @@ jobs:
2122
2223 steps :
2324 - name : Checkout source code
24- uses : actions/checkout@v2
25+ uses : actions/checkout@v3
2526 with :
2627 submodules : true
2728 fetch-depth : 0
2829
2930 - name : Setup Java
30- uses : actions/setup-java@v2
31+ uses : actions/setup-java@v3
3132 with :
3233 distribution : ' temurin'
3334 java-version : ${{ matrix.java }}
3637 - name : Build and (headless) test with Maven
3738 uses : GabrielBB/xvfb-action@v1
3839 with :
39- run : mvn -B -ntp package
40+ run : mvn -U - B -ntp package
4041
4142 snapshot-job :
4243 needs : build-and-test-job
@@ -51,13 +52,13 @@ jobs:
5152
5253 steps :
5354 - name : Checkout source code
54- uses : actions/checkout@v2
55+ uses : actions/checkout@v3
5556 with :
5657 submodules : true
5758 fetch-depth : 0
5859
5960 - name : Setup Java
60- uses : actions/setup-java@v2
61+ uses : actions/setup-java@v3
6162 with :
6263 distribution : ' temurin'
6364 java-version : ${{ matrix.java }}
7172 SIGN_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
7273 SIGN_KEY_PASS : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
7374
75+ - name : Dryrun release assets with Maven
76+ run : mvn -B -ntp install -DskipTests=true -P full-release -Djreleaser.dry.run=true
77+ env :
78+ JRELEASER_GITHUB_TOKEN : ${{ secrets.JRELEASER_GITHUB_TOKEN }}
79+ JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.MAVEN_GPG_PUBLIC_KEY }}
80+ JRELEASER_GPG_SECRET_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
81+ JRELEASER_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
82+
7483 release-job :
7584 needs : build-and-test-job
7685 if : startsWith(github.repository, 'nbbrd/') && startsWith(github.ref, 'refs/tags/v')
@@ -84,13 +93,13 @@ jobs:
8493
8594 steps :
8695 - name : Checkout source code
87- uses : actions/checkout@v2
96+ uses : actions/checkout@v3
8897 with :
8998 submodules : true
9099 fetch-depth : 0
91100
92101 - name : Setup Java
93- uses : actions/setup-java@v2
102+ uses : actions/setup-java@v3
94103 with :
95104 distribution : ' temurin'
96105 java-version : ${{ matrix.java }}
@@ -106,18 +115,10 @@ jobs:
106115 # Fix https://issues.sonatype.org/browse/OSSRH-66257
107116 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"
108117
109- - name : Build assets with Maven
110- run : mvn -B -ntp install -DskipTests=true -P base-deploy
111- env :
112- SIGN_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
113- SIGN_KEY_PASS : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
114-
115- - name : Create dummy file if no assets
116- run : test -d "binaries" || (mkdir binaries && echo "no assets" > binaries/no_assets.txt)
117-
118- - name : Create draft release and upload assets
119- uses : xresloader/upload-to-github-release@v1
118+ - name : Release assets with Maven
119+ run : mvn -B -ntp install -DskipTests=true -P full-release
120120 env :
121- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
122- with :
123- file : ' binaries/*'
121+ JRELEASER_GITHUB_TOKEN : ${{ secrets.JRELEASER_GITHUB_TOKEN }}
122+ JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.MAVEN_GPG_PUBLIC_KEY }}
123+ JRELEASER_GPG_SECRET_KEY : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
124+ JRELEASER_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
0 commit comments