@@ -11,20 +11,30 @@ permissions:
11
11
contents : write
12
12
pull-requests : write
13
13
14
+ # DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario
15
+ # where a supply chain attack could be achieved due to poisoned cache
14
16
jobs :
15
17
check-code :
16
18
runs-on : ubuntu-latest
17
19
timeout-minutes : 30
18
20
steps :
19
21
- uses : actions/checkout@v5
20
-
22
+
21
23
- name : Set up JDK
22
24
uses : actions/setup-java@v5
23
25
with :
24
26
java-version : ' 17'
25
27
distribution : ' temurin'
26
- cache : ' maven'
27
-
28
+
29
+ # Try to reuse existing cache from check-build
30
+ - name : Try restore Maven Cache
31
+ uses : actions/cache/restore@v4
32
+ with :
33
+ path : ~/.m2/repository
34
+ key : ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
35
+ restore-keys : |
36
+ ${{ runner.os }}-mvn-build-
37
+
28
38
- name : Build with Maven
29
39
run : ./mvnw -B clean package -T2C
30
40
@@ -54,31 +64,31 @@ jobs:
54
64
upload_url : ${{ steps.create-release.outputs.upload_url }}
55
65
steps :
56
66
- uses : actions/checkout@v5
57
-
67
+
58
68
- name : Configure Git
59
69
run : |
60
70
git config --global user.email "[email protected] "
61
71
git config --global user.name "GitHub Actions"
62
-
72
+
63
73
- name : Un-SNAP
64
74
run : ./mvnw -B versions:set -DremoveSnapshot -DprocessAllModules -DgenerateBackupPoms=false
65
-
75
+
66
76
- name : Get version
67
77
id : version
68
78
run : |
69
79
version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
70
80
echo "release=$version" >> $GITHUB_OUTPUT
71
81
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
72
82
working-directory : ${{ env.PRIMARY_MAVEN_MODULE }}
73
-
83
+
74
84
- name : Commit and Push
75
85
run : |
76
86
git add -A
77
87
git commit -m "Release ${{ steps.version.outputs.release }}"
78
88
git push origin
79
89
git tag v${{ steps.version.outputs.release }}
80
90
git push origin --tags
81
-
91
+
82
92
- name : Create Release
83
93
id : create-release
84
94
uses : shogo82148/actions-create-release@4661dc54f7b4b564074e9fbf73884d960de569a3 # v1
@@ -106,7 +116,7 @@ jobs:
106
116
timeout-minutes : 60
107
117
steps :
108
118
- uses : actions/checkout@v5
109
-
119
+
110
120
- name : Init Git and pull
111
121
run : |
112
122
git config --global user.email "[email protected] "
@@ -122,7 +132,7 @@ jobs:
122
132
server-password : PACKAGES_CENTRAL_TOKEN
123
133
gpg-passphrase : MAVEN_GPG_PASSPHRASE
124
134
gpg-private-key : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
125
-
135
+
126
136
- name : Publish to GitHub Packages Central
127
137
run : ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
128
138
working-directory : ${{ env.PRIMARY_MAVEN_MODULE }}
@@ -154,7 +164,7 @@ jobs:
154
164
timeout-minutes : 15
155
165
steps :
156
166
- uses : actions/checkout@v5
157
-
167
+
158
168
- name : Init Git and pull
159
169
run : |
160
170
git config --global user.email "[email protected] "
@@ -166,7 +176,15 @@ jobs:
166
176
with :
167
177
java-version : ' 17'
168
178
distribution : ' temurin'
169
- cache : ' maven'
179
+
180
+ # Try to reuse existing cache from check-build
181
+ - name : Try restore Maven Cache
182
+ uses : actions/cache/restore@v4
183
+ with :
184
+ path : ~/.m2/repository
185
+ key : ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
186
+ restore-keys : |
187
+ ${{ runner.os }}-mvn-build-
170
188
171
189
- name : Build site
172
190
run : ../mvnw -B compile site -DskipTests -T2C
@@ -185,7 +203,7 @@ jobs:
185
203
timeout-minutes : 10
186
204
steps :
187
205
- uses : actions/checkout@v5
188
-
206
+
189
207
- name : Init Git and pull
190
208
run : |
191
209
git config --global user.email "[email protected] "
@@ -200,7 +218,7 @@ jobs:
200
218
git add -A
201
219
git commit -m "Preparing for next development iteration"
202
220
git push origin
203
-
221
+
204
222
- name : pull-request
205
223
env :
206
224
GH_TOKEN : ${{ github.token }}
0 commit comments