-
-
Notifications
You must be signed in to change notification settings - Fork 477
429 lines (413 loc) · 18.5 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
name: Build MelonLoader
run-name: ${{ vars.DEVVERSION }}${{ github.event_name != 'workflow_dispatch' && format('-ci.{0}', github.run_number) || '' }} | ${{ github.event_name != 'workflow_dispatch' && (github.event.head_commit.message || format('`[PR]` {0}', github.event.pull_request.title)) || 'Manual Build' }}
on:
push:
branches: [ master, alpha-development, v0.6.0-rewrite ]
pull_request:
branches: [ master, alpha-development, v0.6.0-rewrite ]
workflow_dispatch:
jobs:
build_core:
name: Build Managed Binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore Dependencies
run: dotnet restore
- name: Build Melonloader Core Debug
run: dotnet build --no-restore -c Debug -p:Platform="Windows - x64" -p:Version="${{ vars.DEVVERSION }}${{ github.event_name != 'workflow_dispatch' && format('.{0}', github.run_number) || '' }}" # Platform is actually irrelevant for core, it's compiled as AnyCPU either way
- name: Upload Debug Core Artifact
uses: actions/upload-artifact@v4
with:
name: MLCoreDebug
path: Output/Debug/MelonLoader/
- name: Build MelonLoader Core Release
run: dotnet build --no-restore -c Release -p:Platform="Windows - x64" -p:Version="${{ vars.DEVVERSION }}${{ github.event_name != 'workflow_dispatch' && format('.{0}', github.run_number) || '' }}"
- name: Upload Release Core Artifact
uses: actions/upload-artifact@v4
with:
name: MLCoreRelease
path: Output/Release/MelonLoader/
- name: Pack NuGet Package
run: dotnet pack --no-build -c Release -p:Version="${{ vars.DEVVERSION }}${{ github.event_name != 'workflow_dispatch' && format('-ci.{0}', github.run_number) || '' }}"
- name: Upload NuGet Artifact
uses: actions/upload-artifact@v4
with:
name: MelonLoader.NuGet
path: Output/Release/MelonLoader/LavaGang.MelonLoader.${{ vars.DEVVERSION }}${{ github.event_name != 'workflow_dispatch' && format('-ci.{0}', github.run_number) || '' }}.nupkg
build_rust_windows:
name: Build Native Binaries (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
# Target triple to install for this toolchain
targets: i686-pc-windows-msvc, x86_64-pc-windows-msvc
# Build Rust Release
- name: Build Rust Release | Windows - x86
shell: cmd
run: cargo +nightly build --target i686-pc-windows-msvc --release
- name: Build Rust Release | Windows - x64
shell: cmd
run: cargo +nightly build --target x86_64-pc-windows-msvc --release
# Build Rust Debug
- name: Build Rust Debug | Windows - x86
shell: cmd
run: cargo +nightly build --target i686-pc-windows-msvc
- name: Build Rust Debug | Windows - x64
shell: cmd
run: cargo +nightly build --target x86_64-pc-windows-msvc
# Upload Proxy Release - x86
- name: Upload Proxy Release | Windows x86
uses: actions/upload-artifact@v4
with:
name: MLProxyX86-Windows-Release
path: target/i686-pc-windows-msvc/release/version.dll
# Upload Bootstrap Release - x86
- name: Upload Bootstrap Release | Windows x86
uses: actions/upload-artifact@v4
with:
name: MLBootstrapX86-Windows-Release
path: target/i686-pc-windows-msvc/release/Bootstrap.dll
# Upload Proxy Release - x64
- name: Upload Proxy Release | Windows x64
uses: actions/upload-artifact@v4
with:
name: MLProxyX64-Windows-Release
path: target/x86_64-pc-windows-msvc/release/version.dll
# Upload Bootstrap Release - x64
- name: Upload Bootstrap Release | Windows x64
uses: actions/upload-artifact@v4
with:
name: MLBootstrapX64-Windows-Release
path: target/x86_64-pc-windows-msvc/release/Bootstrap.dll
# Upload Proxy Debug - x86
- name: Upload Proxy Debug | Windows x86
uses: actions/upload-artifact@v4
with:
name: MLProxyX86-Windows-Debug
path: target/i686-pc-windows-msvc/debug/version.dll
# Upload Bootstrap Debug - x86
- name: Upload Bootstrap Debug | Windows x86
uses: actions/upload-artifact@v4
with:
name: MLBootstrapX86-Windows-Debug
path: target/i686-pc-windows-msvc/debug/Bootstrap.dll
# Upload Proxy Debug - x64
- name: Upload Proxy Debug | Windows x64
uses: actions/upload-artifact@v4
with:
name: MLProxyX64-Windows-Debug
path: target/x86_64-pc-windows-msvc/debug/version.dll
# Upload Bootstrap Debug - x64
- name: Upload Bootstrap Debug | Windows x64
uses: actions/upload-artifact@v4
with:
name: MLBootstrapX64-Windows-Debug
path: target/x86_64-pc-windows-msvc/debug/Bootstrap.dll
build_rust_linux:
name: Build Native Binaries (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
# Target triple to install for this toolchain
targets: x86_64-unknown-linux-gnu
- name: update environment
shell: bash
run: sudo apt-get update
- name: install dev dependencies
shell: bash
run: sudo apt-get install libgtk-3-dev
- name: Build Rust Release | Linux - x64
shell: bash
run: cargo +nightly build --target x86_64-unknown-linux-gnu --release
- name: Build Rust Debug | Linux - x64
shell: bash
run: cargo +nightly build --target x86_64-unknown-linux-gnu
- name: Upload Proxy Release | Linux x64
uses: actions/upload-artifact@v4
with:
name: MLProxyX64-Linux-Release
path: target/x86_64-unknown-linux-gnu/release/libversion.so
- name: Upload Bootstrap Release | Linux x64
uses: actions/upload-artifact@v4
with:
name: MLBootstrapX64-Linux-Release
path: target/x86_64-unknown-linux-gnu/release/libBootstrap.so
- name: Upload Proxy Debug | Linux x64
uses: actions/upload-artifact@v4
with:
name: MLProxyX64-Linux-Debug
path: target/x86_64-unknown-linux-gnu/debug/libversion.so
- name: Upload Bootstrap Debug | Linux x64
uses: actions/upload-artifact@v4
with:
name: MLBootstrapX64-Linux-Debug
path: target/x86_64-unknown-linux-gnu/debug/libBootstrap.so
finalize_windows:
name: Finalize Windows Artifacts
runs-on: ubuntu-22.04
needs: [build_core, build_rust_windows]
steps:
- uses: actions/checkout@v4
- name: Download Debug Managed Artifact
uses: actions/download-artifact@v4
with:
name: MLCoreDebug
path: Output/Debug/Managed/
- name: Download Debug Proxy x64 Artifact
uses: actions/download-artifact@v4
with:
name: MLProxyX64-Windows-Debug
path: Output/Debug/x64/
- name: Download Debug Bootstrap x64 Artifact
uses: actions/download-artifact@v4
with:
name: MLBootstrapX64-Windows-Debug
path: Output/Debug/x64/MelonLoader/Dependencies/
- name: Package Debug x64 Artifact
run: |
echo Copying Managed Libs...
mkdir -p Output/Debug/x64/MelonLoader/Dependencies/Mono
cp -r Output/Debug/Managed/* Output/Debug/x64/MelonLoader/
cp -r BaseLibs/Mono Output/Debug/x64/MelonLoader/Dependencies/
cp -r BaseLibs/net35 Output/Debug/x64/MelonLoader/
cp -r BaseLibs/net6 Output/Debug/x64/MelonLoader/
mkdir -p Output/Debug/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
cp -r BaseLibs/NetStandardPatches Output/Debug/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
echo
echo Copying Dobby x64...
cp BaseLibs/dobby_x64.dll Output/Debug/x64/MelonLoader/Dependencies/dobby.dll
echo
echo Copying documentation files...
mkdir -p Output/Debug/x64/MelonLoader/Documentation
cp CHANGELOG.md Output/Debug/x64/MelonLoader/Documentation/
cp LICENSE.md Output/Debug/x64/MelonLoader/Documentation/
cp NOTICE.txt Output/Debug/x64/MelonLoader/Documentation/
cp README.md Output/Debug/x64/MelonLoader/Documentation/
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - Debug - x64
with:
name: MelonLoader.Windows.x64.CI.Debug
path: ./Output/Debug/x64/*
- name: Download Release Managed Artifact
uses: actions/download-artifact@v4
with:
name: MLCoreRelease
path: Output/Release/Managed/
- name: Download Release Proxy x64 Artifact
uses: actions/download-artifact@v4
with:
name: MLProxyX64-Windows-Release
path: Output/Release/x64/
- name: Download Debug Bootstrap x64 Artifact
uses: actions/download-artifact@v4
with:
name: MLBootstrapX64-Windows-Release
path: Output/Release/x64/MelonLoader/Dependencies/
- name: Package Release x64 Artifact
run: |
echo Copying Managed Libs...
mkdir -p Output/Release/x64/MelonLoader/Dependencies/Mono
cp -r Output/Release/Managed/* Output/Release/x64/MelonLoader/
cp -r BaseLibs/Mono Output/Release/x64/MelonLoader/Dependencies/
cp -r BaseLibs/net35 Output/Release/x64/MelonLoader/
cp -r BaseLibs/net6 Output/Release/x64/MelonLoader/
mkdir -p Output/Release/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
cp -r BaseLibs/NetStandardPatches Output/Release/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
echo
echo Copying Dobby x64...
cp BaseLibs/dobby_x64.dll Output/Release/x64/MelonLoader/Dependencies/dobby.dll
echo
echo Copying documentation files...
mkdir -p Output/Release/x64/MelonLoader/Documentation
cp CHANGELOG.md Output/Release/x64/MelonLoader/Documentation/
cp LICENSE.md Output/Release/x64/MelonLoader/Documentation/
cp NOTICE.txt Output/Release/x64/MelonLoader/Documentation/
cp README.md Output/Release/x64/MelonLoader/Documentation/
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - Release - x64
with:
name: MelonLoader.Windows.x64.CI.Release
path: ./Output/Release/x64/*
- name: Download Debug Proxy x86 Artifact
uses: actions/download-artifact@v4
with:
name: MLProxyX86-Windows-Debug
path: Output/Debug/x86/
- name: Download Debug Bootstrap x86 Artifact
uses: actions/download-artifact@v4
with:
name: MLBootstrapX86-Windows-Debug
path: Output/Debug/x86/MelonLoader/Dependencies/
- name: Package Debug x86 Artifact
run: |
echo Copying Managed Libs...
mkdir -p Output/Debug/x86/MelonLoader/Dependencies/Mono
cp -r Output/Debug/Managed/* Output/Debug/x86/MelonLoader/
cp -r BaseLibs/Mono Output/Debug/x86/MelonLoader/Dependencies/
cp -r BaseLibs/net35 Output/Debug/x86/MelonLoader/
cp -r BaseLibs/net6 Output/Debug/x86/MelonLoader/
mkdir -p Output/Debug/x86/MelonLoader/Dependencies/SupportModules/NetStandardPatches
cp -r BaseLibs/NetStandardPatches Output/Debug/x86/MelonLoader/Dependencies/SupportModules/NetStandardPatches
echo
echo Copying Dobby x86...
cp BaseLibs/dobby_x86.dll Output/Debug/x86/MelonLoader/Dependencies/dobby.dll
echo
echo Copying documentation files...
mkdir -p Output/Debug/x86/MelonLoader/Documentation
cp CHANGELOG.md Output/Debug/x86/MelonLoader/Documentation/
cp LICENSE.md Output/Debug/x86/MelonLoader/Documentation/
cp NOTICE.txt Output/Debug/x86/MelonLoader/Documentation/
cp README.md Output/Debug/x86/MelonLoader/Documentation/
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - Debug - x86
with:
name: MelonLoader.Windows.x86.CI.Debug
path: ./Output/Debug/x86/*
- name: Download Release Proxy x86 Artifact
uses: actions/download-artifact@v4
with:
name: MLProxyX86-Windows-Release
path: Output/Release/x86/
- name: Download Release Bootstrap x86 Artifact
uses: actions/download-artifact@v4
with:
name: MLBootstrapX86-Windows-Release
path: Output/Release/x86/MelonLoader/Dependencies/
- name: Package Release x86 Artifact
run: |
echo Copying Managed Libs...
mkdir -p Output/Release/x86/MelonLoader/Dependencies/Mono
cp -r Output/Release/Managed/* Output/Release/x86/MelonLoader/
cp -r BaseLibs/Mono Output/Release/x86/MelonLoader/Dependencies/
cp -r BaseLibs/net35 Output/Release/x86/MelonLoader/
cp -r BaseLibs/net6 Output/Release/x86/MelonLoader/
mkdir -p Output/Release/x86/MelonLoader/Dependencies/SupportModules/NetStandardPatches
cp -r BaseLibs/NetStandardPatches Output/Release/x86/MelonLoader/Dependencies/SupportModules/NetStandardPatches
echo
echo Copying Dobby x86...
cp BaseLibs/dobby_x86.dll Output/Release/x86/MelonLoader/Dependencies/dobby.dll
echo
echo Copying documentation files...
mkdir -p Output/Release/x86/MelonLoader/Documentation
cp CHANGELOG.md Output/Release/x86/MelonLoader/Documentation/
cp LICENSE.md Output/Release/x86/MelonLoader/Documentation/
cp NOTICE.txt Output/Release/x86/MelonLoader/Documentation/
cp README.md Output/Release/x86/MelonLoader/Documentation/
- uses: actions/upload-artifact@v4
name: Upload Zip | Windows - Release - x86
with:
name: MelonLoader.Windows.x86.CI.Release
path: ./Output/Release/x86/*
finalize_linux:
name: Finalize Linux Artifacts
runs-on: ubuntu-22.04
needs: [build_core, build_rust_linux]
steps:
- uses: actions/checkout@v4
- name: Download Debug Managed Artifact
uses: actions/download-artifact@v4
with:
name: MLCoreDebug
path: Output/Debug/x64/MelonLoader/
- name: Download Debug Proxy Artifact
uses: actions/download-artifact@v4
with:
name: MLProxyX64-Linux-Debug
path: Output/Debug/x64/
- name: Download Debug Bootstrap Artifact
uses: actions/download-artifact@v4
with:
name: MLBootstrapX64-Linux-Debug
path: Output/Debug/x64/MelonLoader/Dependencies/
- name: Package Debug Zip
run: |
echo Copying Managed Libs...
mkdir -p Output/Debug/x64/MelonLoader/Dependencies/Mono
cp -r BaseLibs/Mono Output/Debug/x64/MelonLoader/Dependencies/
cp -r BaseLibs/net35 Output/Debug/x64/MelonLoader/
cp -r BaseLibs/net6 Output/Debug/x64/MelonLoader/
mkdir -p Output/Debug/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
cp -r BaseLibs/NetStandardPatches Output/Debug/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
echo
echo Copying documentation files...
mkdir -p Output/Debug/x64/MelonLoader/Documentation
cp CHANGELOG.md Output/Debug/x64/MelonLoader/Documentation/
cp LICENSE.md Output/Debug/x64/MelonLoader/Documentation/
cp NOTICE.txt Output/Debug/x64/MelonLoader/Documentation/
cp README.md Output/Debug/x64/MelonLoader/Documentation/
- uses: actions/upload-artifact@v4
name: Upload Zip | Linux - Debug - x64
with:
name: MelonLoader.Linux.x64.CI.Debug
path: ./Output/Debug/x64/*
- name: Download Release Managed Artifact
uses: actions/download-artifact@v4
with:
name: MLCoreRelease
path: Output/Release/x64/MelonLoader/
- name: Download Release Proxy Artifact
uses: actions/download-artifact@v4
with:
name: MLProxyX64-Linux-Release
path: Output/Release/x64/
- name: Download Release Bootstrap Artifact
uses: actions/download-artifact@v4
with:
name: MLBootstrapX64-Linux-Release
path: Output/Release/x64/MelonLoader/Dependencies/
- name: Package Release Zip
run: |
echo Copying Managed Libs...
mkdir -p Output/Release/x64/MelonLoader/Dependencies/Mono
cp -r BaseLibs/Mono Output/Release/x64/MelonLoader/Dependencies/
cp -r BaseLibs/net35 Output/Release/x64/MelonLoader/
cp -r BaseLibs/net6 Output/Release/x64/MelonLoader/
mkdir -p Output/Release/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
cp -r BaseLibs/NetStandardPatches Output/Release/x64/MelonLoader/Dependencies/SupportModules/NetStandardPatches
echo
echo Copying documentation files...
mkdir -p Output/Release/x64/MelonLoader/Documentation
cp CHANGELOG.md Output/Release/x64/MelonLoader/Documentation/
cp LICENSE.md Output/Release/x64/MelonLoader/Documentation/
cp NOTICE.txt Output/Release/x64/MelonLoader/Documentation/
cp README.md Output/Release/x64/MelonLoader/Documentation/
- uses: actions/upload-artifact@v4
name: Upload Zip | Linux - Release - x64
with:
name: MelonLoader.Linux.x64.CI.Release
path: ./Output/Release/x64/*
cleanup_artifacts:
name: Cleanup Artifacts
runs-on: ubuntu-22.04
needs: [finalize_windows, finalize_linux]
steps:
- uses: GeekyEggo/delete-artifact@v5.0.0
with:
name: |
MLCoreDebug
MLCoreRelease
MLProxyX86-Windows-Debug
MLBootstrapX86-Windows-Debug
MLProxyX64-Windows-Debug
MLBootstrapX64-Windows-Debug
MLProxyX64-Linux-Debug
MLBootstrapX64-Linux-Debug
MLProxyX86-Windows-Release
MLBootstrapX86-Windows-Release
MLProxyX64-Windows-Release
MLBootstrapX64-Windows-Release
MLProxyX64-Linux-Release
MLBootstrapX64-Linux-Release