@@ -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
- - uses : actions/checkout@v4
20
-
21
+ - uses : actions/checkout@v5
22
+
21
23
- name : Set up JDK
22
- uses : actions/setup-java@v4
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
@@ -53,32 +63,32 @@ jobs:
53
63
outputs :
54
64
upload_url : ${{ steps.create-release.outputs.upload_url }}
55
65
steps :
56
- - uses : actions/checkout@v4
57
-
66
+ - uses : actions/checkout@v5
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
@@ -105,24 +115,24 @@ jobs:
105
115
needs : [prepare-release]
106
116
timeout-minutes : 60
107
117
steps :
108
- - uses : actions/checkout@v4
109
-
118
+ - uses : actions/checkout@v5
119
+
110
120
- name : Init Git and pull
111
121
run : |
112
122
git config --global user.email "[email protected] "
113
123
git config --global user.name "GitHub Actions"
114
124
git pull
115
125
116
126
- name : Set up JDK
117
- uses : actions/setup-java@v4
127
+ uses : actions/setup-java@v5
118
128
with : # running setup-java overwrites the settings.xml
119
129
distribution : ' temurin'
120
130
java-version : ' 17'
121
131
server-id : github-central
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 }}
@@ -131,7 +141,7 @@ jobs:
131
141
MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
132
142
133
143
- name : Set up JDK
134
- uses : actions/setup-java@v4
144
+ uses : actions/setup-java@v5
135
145
with : # running setup-java again overwrites the settings.xml
136
146
distribution : ' temurin'
137
147
java-version : ' 17'
@@ -153,20 +163,28 @@ jobs:
153
163
needs : [prepare-release]
154
164
timeout-minutes : 15
155
165
steps :
156
- - uses : actions/checkout@v4
157
-
166
+ - uses : actions/checkout@v5
167
+
158
168
- name : Init Git and pull
159
169
run : |
160
170
git config --global user.email "[email protected] "
161
171
git config --global user.name "GitHub Actions"
162
172
git pull
163
173
164
174
- name : Setup - Java
165
- uses : actions/setup-java@v4
175
+ uses : actions/setup-java@v5
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
@@ -184,8 +202,8 @@ jobs:
184
202
needs : [publish-maven]
185
203
timeout-minutes : 10
186
204
steps :
187
- - uses : actions/checkout@v4
188
-
205
+ - uses : actions/checkout@v5
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