@@ -8,20 +8,30 @@ permissions:
88 contents : write
99 pull-requests : write
1010
11+ # DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario
12+ # where a supply chain attack could be achieved due to poisoned cache
1113jobs :
1214 check-code :
1315 runs-on : ubuntu-latest
1416 timeout-minutes : 30
1517 steps :
1618 - uses : actions/checkout@v5
17-
19+
1820 - name : Set up JDK
1921 uses : actions/setup-java@v5
2022 with :
2123 java-version : ' 17'
2224 distribution : ' temurin'
23- cache : ' maven'
24-
25+
26+ # Try to reuse existing cache from check-build
27+ - name : Try restore Maven Cache
28+ uses : actions/cache/restore@v4
29+ with :
30+ path : ~/.m2/repository
31+ key : ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
32+ restore-keys : |
33+ ${{ runner.os }}-mvn-build-
34+
2535 - name : Build with Maven
2636 run : ./mvnw -B clean package -T2C
2737
@@ -52,30 +62,30 @@ jobs:
5262 version : ${{ steps.version.outputs.release }}
5363 steps :
5464 - uses : actions/checkout@v5
55-
65+
5666 - name : Configure Git
5767 run : |
5868 git config --global user.email "actions@github.com"
5969 git config --global user.name "GitHub Actions"
60-
70+
6171 - name : Un-SNAP
6272 run : ./mvnw -B versions:set -DremoveSnapshot -DprocessAllModules -DgenerateBackupPoms=false
63-
73+
6474 - name : Get version
6575 id : version
6676 run : |
6777 version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
6878 echo "release=$version" >> $GITHUB_OUTPUT
6979 echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
70-
80+
7181 - name : Commit and Push
7282 run : |
7383 git add -A
7484 git commit -m "Release ${{ steps.version.outputs.release }}"
7585 git push origin
7686 git tag v${{ steps.version.outputs.release }}
7787 git push origin --tags
78-
88+
7989 - name : Create Release
8090 id : create-release
8191 uses : shogo82148/actions-create-release@4661dc54f7b4b564074e9fbf73884d960de569a3 # v1
@@ -130,7 +140,7 @@ jobs:
130140 timeout-minutes : 60
131141 steps :
132142 - uses : actions/checkout@v5
133-
143+
134144 - name : Init Git and pull
135145 run : |
136146 git config --global user.email "actions@github.com"
@@ -272,7 +282,7 @@ jobs:
272282 timeout-minutes : 15
273283 steps :
274284 - uses : actions/checkout@v5
275-
285+
276286 - name : Init Git and pull
277287 run : |
278288 git config --global user.email "actions@github.com"
@@ -284,7 +294,15 @@ jobs:
284294 with :
285295 java-version : ' 17'
286296 distribution : ' temurin'
287- cache : ' maven'
297+
298+ # Try to reuse existing cache from check-build
299+ - name : Try restore Maven Cache
300+ uses : actions/cache/restore@v4
301+ with :
302+ path : ~/.m2/repository
303+ key : ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
304+ restore-keys : |
305+ ${{ runner.os }}-mvn-build-
288306
289307 - name : Build site
290308 run : ./mvnw -B compile site -DskipTests -T2C
@@ -311,7 +329,7 @@ jobs:
311329 timeout-minutes : 10
312330 steps :
313331 - uses : actions/checkout@v5
314-
332+
315333 - name : Init Git and pull
316334 run : |
317335 git config --global user.email "actions@github.com"
@@ -326,7 +344,7 @@ jobs:
326344 git add -A
327345 git commit -m "Preparing for next development iteration"
328346 git push origin
329-
347+
330348 - name : pull-request
331349 env :
332350 GH_TOKEN : ${{ github.token }}
0 commit comments