5
5
branches : [ 'minecraft/*' ]
6
6
7
7
jobs :
8
- initialize :
8
+ build :
9
9
runs-on : ubuntu-22.04
10
10
steps :
11
11
- name : Checkout repository
12
12
uses : actions/checkout@v4
13
13
14
14
- name : Validate Gradle wrapper
15
- uses : gradle/wrapper-validation-action@v1
15
+ uses : gradle/wrapper-validation-action@v2
16
16
17
17
- name : Setup JDK 17
18
18
uses : actions/setup-java@v4
@@ -26,208 +26,38 @@ jobs:
26
26
path : |
27
27
~/.gradle/caches
28
28
~/.gradle/wrapper
29
- ./.gradle
30
- ./common/.gradle
31
- ./fabric/.gradle
32
- ./neoforge/.gradle
33
- key : ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
29
+ .gradle
30
+ common/.gradle
31
+ fabric/.gradle
32
+ neoforge/.gradle
33
+ neoforge/build/jars
34
+ neoforge/build/neoForge
35
+ neoforge/build/neoForm
36
+ neoforge/build/tmp/neoFormRecompile
37
+ key : ${{ runner.os }}-gradle-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', '**/build.gradle.kts', '**/gradle.properties') }}-${{github.ref_name}}
34
38
restore-keys : |
35
- ${{ runner.os }}-gradle-${{github.ref_name}}-
39
+ ${{ runner.os }}-gradle-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', '**/build.gradle.kts', '**/gradle.properties') }}
36
40
${{ runner.os }}-gradle-
37
41
38
- - name : Initialize caches
39
- run : ./gradlew --no-daemon
40
-
41
- license-headers :
42
- needs : initialize
43
- runs-on : ubuntu-22.04
44
- steps :
45
- - name : Checkout repository
46
- uses : actions/checkout@v4
47
-
48
- - name : Setup JDK 17
49
- uses : actions/setup-java@v4
50
- with :
51
- java-version : 17
52
- distribution : temurin
53
-
54
- - name : Restore gradle cache
55
- uses : actions/cache/restore@v4
56
- with :
57
- fail-on-cache-miss : true
58
- path : |
59
- ~/.gradle/caches
60
- ~/.gradle/wrapper
61
- ./.gradle
62
- ./common/.gradle
63
- ./fabric/.gradle
64
- ./neoforge/.gradle
65
- key : ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
66
-
67
- - name : License headers
68
- run : ./gradlew checkLicenses --no-daemon
69
-
70
- build :
71
- needs : initialize
72
- runs-on : ubuntu-22.04
73
-
74
- steps :
75
- - name : Checkout repository
76
- uses : actions/checkout@v4
77
-
78
- - name : Setup JDK 17
79
- uses : actions/setup-java@v4
80
- with :
81
- java-version : 17
82
- distribution : temurin
83
-
84
- - name : Restore gradle cache
85
- uses : actions/cache/restore@v4
86
- with :
87
- fail-on-cache-miss : true
88
- path : |
89
- ~/.gradle/caches
90
- ~/.gradle/wrapper
91
- ./.gradle
92
- ./common/.gradle
93
- ./fabric/.gradle
94
- ./neoforge/.gradle
95
- key : ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
96
-
97
- - name : Build
98
- run : ./gradlew assemble testClasses -x checkLicenses --no-daemon
99
-
100
- - name : Cache build output
101
- uses : actions/cache/save@v4
102
- with :
103
- path : |
104
- ./common/build
105
- ./fabric/build
106
- ./neoforge/build
107
- key : ${{ runner.os }}-build-${{ github.sha }}
108
-
109
- analysis :
110
- needs : initialize
111
- runs-on : ubuntu-22.04
112
- permissions :
113
- security-events : write
114
-
115
- steps :
116
- - name : Checkout repository
117
- uses : actions/checkout@v4
118
-
119
- - name : Setup JDK 17
120
- uses : actions/setup-java@v4
121
- with :
122
- java-version : 17
123
- distribution : temurin
124
-
125
- - name : Restore gradle cache
126
- uses : actions/cache/restore@v4
127
- with :
128
- fail-on-cache-miss : true
129
- path : |
130
- ~/.gradle/caches
131
- ~/.gradle/wrapper
132
- ./.gradle
133
- ./common/.gradle
134
- ./fabric/.gradle
135
- ./neoforge/.gradle
136
- key : ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
42
+ - name : Initialize build environment
43
+ run : ./gradlew
137
44
138
- - name : Initialize CodeQL
139
- uses : github/codeql-action/init@v3
140
- with :
141
- languages : java
45
+ - name : Check license headers
46
+ run : ./gradlew checkLicenses
142
47
143
48
- name : Build
144
- run : ./gradlew assemble testClasses -x checkLicenses --no-daemon
145
-
146
- - name : Perform CodeQL Analysis
147
- uses : github/codeql-action/analyze@v3
148
-
149
- test :
150
- needs : build
151
- runs-on : ubuntu-22.04
152
-
153
- steps :
154
- - name : Checkout repository
155
- uses : actions/checkout@v4
156
-
157
- - name : Setup JDK 17
158
- uses : actions/setup-java@v4
159
- with :
160
- java-version : 17
161
- distribution : temurin
162
-
163
- - name : Restore gradle cache
164
- uses : actions/cache/restore@v4
165
- with :
166
- fail-on-cache-miss : true
167
- path : |
168
- ~/.gradle/caches
169
- ~/.gradle/wrapper
170
- ./.gradle
171
- ./common/.gradle
172
- ./fabric/.gradle
173
- ./neoforge/.gradle
174
- key : ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
175
-
176
- - name : Restore cached build output
177
- uses : actions/cache/restore@v4
178
- with :
179
- fail-on-cache-miss : true
180
- path : |
181
- .gradle/
182
- !.gradle/loom-cache
183
- build/
184
- key : ${{ runner.os }}-build-${{ github.sha }}
49
+ if : ${{ !cancelled() }}
50
+ id : build
51
+ run : ./gradlew assemble -x checkLicenses
185
52
186
53
- name : Test
187
- run : ./gradlew :fabric:runGametest :neoforge:runGameTestServer --no-daemon
188
-
189
- publish :
190
- if : github.repository == 'TeamGalacticraft/DynamicDimensions'
191
- needs : [ test, license-headers, analysis ]
192
- runs-on : ubuntu-22.04
193
-
194
- steps :
195
- - name : Checkout repository
196
- uses : actions/checkout@v4
197
-
198
- - name : Setup JDK 17
199
- uses : actions/setup-java@v4
200
- with :
201
- java-version : 17
202
- distribution : temurin
203
-
204
- - name : Restore gradle cache
205
- uses : actions/cache/restore@v4
206
- with :
207
- fail-on-cache-miss : true
208
- path : |
209
- ~/.gradle/caches
210
- ~/.gradle/wrapper
211
- ./.gradle
212
- ./common/.gradle
213
- ./fabric/.gradle
214
- ./neoforge/.gradle
215
- key : ${{ runner.os }}-gradle-${{github.ref_name}}-${{ hashFiles('gradle/gradle-wrapper.properties', 'settings.gradle.kts', 'build.gradle.kts', 'gradle.properties') }}
216
-
217
- - name : Restore cached build output
218
- uses : actions/cache/restore@v4
219
- with :
220
- fail-on-cache-miss : true
221
- path : |
222
- .gradle/
223
- !.gradle/loom-cache
224
- build/
225
- key : ${{ runner.os }}-build-${{ github.sha }}
54
+ if : ${{ steps.build.outcome == 'success' && !cancelled() }}
55
+ run : ./gradlew :fabric:runGametest :neoforge:runGameTestServer
226
56
227
57
- name : Publish
58
+ if : ${{ github.repository == 'TeamGalacticraft/DynamicDimensions' && success() }}
228
59
run : ./gradlew publish -x test --no-daemon
229
60
env :
230
- BUILD_NUMBER : ${{ github.run_number }}
231
61
NEXUS_REPOSITORY_URL : ${{ secrets.NEXUS_RELEASE_URL }}
232
62
NEXUS_USER : ${{ secrets.NEXUS_USER }}
233
63
NEXUS_PASSWORD : ${{ secrets.NEXUS_PASSWORD }}
0 commit comments