-
Notifications
You must be signed in to change notification settings - Fork 112
506 lines (440 loc) · 16.4 KB
/
engine.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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
name: Engine
on:
workflow_call:
inputs:
environment:
required: true
type: string
self-hosted-runner:
required: true
type: boolean
deploy-to-gcp:
required: false
type: boolean
default: true
secrets:
GCP_BUCKET_UPLOAD:
required: false
outputs:
commit_hash:
value: ${{ jobs.build-windows.outputs.commit_hash }}
defaults:
run:
working-directory: ./godot-engine
# Global Settings
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
SCONSFLAGS: verbose=yes warnings=extra werror=no module_text_server_fb_enabled=yes fontconfig=no
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt
concurrency:
# workflow name - PR || fallback to unique run id, this happens when you're not building a PR
# this ensures all branches build properly and cancel their previous runs
group: engine-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-windows:
runs-on: ${{ inputs.self-hosted-runner && 'windows-mirror' || 'windows-latest' }}
name: ${{ matrix.name }}
environment: ${{ inputs.environment }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows Editor
cache-name: windows-editor
target: editor
strip: true
tests: false
sconsflags: arch=x86_64 debug_symbols=no windows_subsystem=console optimize=speed production=yes
bin: "./bin/godot.windows.editor.x86_64"
artifact-name: "MirrorGodotEditorWindows"
artifact: true
bucket-name: mirror_native_client_builds/Engine
- name: Windows Template
cache-name: windows-template
target: template_debug
strip: true
tests: false
sconsflags: arch=x86_64 debug_symbols=no optimize=speed
bin: "./bin/godot.windows.template_debug.x86_64"
artifact-name: "windows_release_x86_64"
artifact: true
bucket-name: mirror_native_client_builds/Engine
outputs:
commit_hash: ${{ steps.vars.outputs.sha_short }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get short commit hash
id: vars
run: |
echo "Git hash: $(git rev-parse --short=8 HEAD)"
echo "sha_short=$(git rev-parse --short=8 HEAD)" >> $Env:GITHUB_OUTPUT
- name: Ensuring git hash exists (or will fail job)
if: steps.vars.outputs.sha_short == ''
run: exit 1
- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup python and scons
uses: ./godot-engine/.github/actions/godot-deps
#- name: Download Direct3D 12 SDK components
# run: python ./misc/scripts/install_d3d12_sdk_windows.py
- name: Setup MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: windows
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Strip binaries
if: ${{ matrix.strip }}
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
- name: Move PDB file (if not stripped)
if: ${{ !matrix.strip }}
run: |
dir -Path ./bin/
mv ${{matrix.bin}}.pdb bin/${{ matrix.artifact-name}}.pdb
- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
mv ${{ matrix.bin }}.exe bin/${{ matrix.artifact-name }}.exe
- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
path: ./godot-engine/bin/${{ matrix.artifact-name }}.exe
name: ${{ matrix.artifact-name }}.exe
- uses: 'google-github-actions/auth@v2'
if: ${{ inputs.deploy-to-gcp }}
with:
credentials_json: '${{ secrets.GCP_BUCKET_UPLOAD }}'
- name: Upload binary
if: ${{ inputs.deploy-to-gcp }}
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ./godot-engine/bin/${{ matrix.artifact-name }}.exe
destination: ${{ matrix.bucket-name }}/${{steps.vars.outputs.sha_short}}/
build-macos:
runs-on: ${{ inputs.self-hosted-runner && 'macos-mirror' || 'macos-latest' }}
name: ${{ matrix.name }}
environment: ${{ inputs.environment }}
strategy:
fail-fast: false
matrix:
include:
- name: MacOS Editor
cache-name: macos-editor
target: editor
tests: false
strip: true
sconsflags: debug_symbols=no optimize=speed production=yes use_static_cpp=yes
dist-app: "macos_tools.app"
packaged-app: "MirrorGodotEditorMac.app"
bin-name: "godot.macos.editor.universal"
bin-name-x86_64: "godot.macos.editor.x86_64"
bin-name-arm64: "godot.macos.editor.arm64"
artifact-bin-name: "Godot"
artifact-name: "MirrorGodotEditorMac.app"
bucket-name: mirror_native_client_builds/Engine
- name: MacOS Template
cache-name: macos-template
target: template_debug
tests: false
strip: true
sconsflags: debug_symbols=no optimize=speed use_static_cpp=yes
dist-app: "macos_template.app"
packaged-app: "macos_template.app"
bin-name: "godot.macos.template_debug.universal"
bin-name-x86_64: "godot.macos.template_debug.x86_64"
bin-name-arm64: "godot.macos.template_debug.arm64"
artifact-bin-name: "godot_macos_release.universal"
artifact-name: "macos_template.app"
bucket-name: mirror_native_client_builds/Engine
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get short commit hash
id: vars
run: |
echo "Git hash: $(git rev-parse --short=8 HEAD)"
echo "sha_short=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT
- name: Ensuring git hash exists (or will fail job)
if: steps.vars.outputs.sha_short == ''
run: exit 1
- name: Setup python and scons
uses: ./godot-engine/.github/actions/godot-deps
- name: Setup Vulkan SDK
run: |
sh ./misc/scripts/install_vulkan_sdk_macos.sh
- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup scons (python is already installed on self-hosted runners!)
shell: bash
run: |
python3 -c "import sys; print(sys.version)"
python3 -m ensurepip --upgrade
python3 -m pip install --user scons
scons --version
- name: Setup cmake
shell: bash
run: |
brew install cmake
cmake --version
- name: Remove existing binaries
run: |
rm -Rf bin/
- name: Compilation (x86_64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} arch=x86_64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Compilation (arm64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} arch=arm64
platform: macos
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Strip binaries
if: ${{ matrix.strip }}
run: |
echo "Stripping binaries"
strip bin/*
- name: Prepare universal executable
run: |
lipo -create bin/${{ matrix.bin-name-x86_64 }} bin/${{ matrix.bin-name-arm64 }} -output bin/${{ matrix.bin-name }}
chmod -R +x bin/*
- name: Package in macOS app bundle
shell: sh
run: |
cp -R misc/dist/${{ matrix.dist-app }} bin/${{ matrix.packaged-app }}
cd bin/
mkdir -p ${{ matrix.packaged-app }}/Contents/MacOS
cp ${{ matrix.bin-name }} ${{ matrix.packaged-app }}/Contents/MacOS/${{ matrix.artifact-bin-name }}
chmod -R +x ${{ matrix.packaged-app }}
xattr -rc ${{ matrix.packaged-app }}
zip -q -9 -r ${{ matrix.artifact-name }}.zip ${{ matrix.packaged-app }}
- name: Upload artifact
uses: ./.github/actions/upload-artifact
with:
name: "${{ matrix.artifact-name }}.zip"
path: "./godot-engine/bin/${{ matrix.artifact-name }}.zip"
- uses: 'google-github-actions/auth@v2'
if: ${{ inputs.deploy-to-gcp }}
with:
credentials_json: '${{ secrets.GCP_BUCKET_UPLOAD }}'
- name: Upload binary
if: ${{ inputs.deploy-to-gcp }}
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ./godot-engine/bin/${{ matrix.artifact-name }}.zip
destination: ${{ matrix.bucket-name }}/${{steps.vars.outputs.sha_short}}/
build-linux:
runs-on: ${{ inputs.self-hosted-runner && 'linux-mirror' || 'ubuntu-22.04' }}
name: ${{ matrix.name }}
environment: ${{ inputs.environment }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux Editor
cache-name: linux-editor
target: editor
sconsflags: arch=x86_64 debug_symbols=yes optimize=speed_trace use_static_cpp=yes
strip: false
bin: "./bin/godot.linuxbsd.editor.x86_64"
artifact-name: "MirrorGodotEditorLinux.x86_64"
artifact: true
tests: no
bucket-name: mirror_native_client_builds/Engine
- name: Linux Template
cache-name: linux-template
target: template_debug
strip: true
sconsflags: arch=x86_64 debug_symbols=no optimize=speed use_static_cpp=yes
bin: "./bin/godot.linuxbsd.template_debug.x86_64"
artifact-name: "linux_release.x86_64"
artifact: true
tests: no
bucket-name: mirror_native_client_builds/Engine
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Check versions of the compiler
run: |
ldd --version
gcc --version
cmake --version
- name: Get short commit hash
id: vars
run: |
echo "Git hash: $(git rev-parse --short=8 HEAD)"
echo "sha_short=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT
- name: Ensuring git hash exists (or will fail job)
if: steps.vars.outputs.sha_short == ''
run: exit 1
- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup scons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
scons --version
- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: linuxbsd
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Strip binaries
if: ${{ matrix.strip }}
run: |
strip bin/godot.*
# - name: Shrink debug symbols
# if: ${{ !matrix.strip }}
# run: |
# # remove duplicate symbols from binary
# dwz ${{ matrix.bin }} -L none -o Middleman.debug
# # make the debug symbols compressed
# objcopy --compress-debug-sections Middleman.debug FinalMan.debug
# # overwrite the original file
# mv FinalMan.debug ${{ matrix.bin }}
- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
chmod +x bin/godot.*
mv ${{ matrix.bin }} bin/${{ matrix.artifact-name }}
- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
path: ./godot-engine/bin/${{ matrix.artifact-name }}
name: ${{ matrix.artifact-name }}
- uses: 'google-github-actions/auth@v2'
if: ${{ inputs.deploy-to-gcp }}
with:
credentials_json: '${{ secrets.GCP_BUCKET_UPLOAD }}'
- name: Upload binary
if: ${{ inputs.deploy-to-gcp }}
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ./godot-engine/bin/${{ matrix.artifact-name }}
destination: ${{ matrix.bucket-name }}/${{steps.vars.outputs.sha_short}}/
build-android-linux:
runs-on: ${{ inputs.self-hosted-runner && 'linux-mirror' || 'ubuntu-22.04' }}
name: ${{ matrix.name }}
environment: ${{ inputs.environment }}
strategy:
fail-fast: false
matrix:
include:
- name: Android Template
cache-name: android-template
target: template_debug
strip: true
sconsflags: debug_symbols=no optimize=speed use_static_cpp=yes
bin: "./bin/godot.linuxbsd.template_debug.x86_64"
artifact-name: "android-template"
artifact: true
tests: no
bucket-name: mirror_native_client_builds/Engine
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Ninja 🥷
run: |
sudo apt-get install ninja-build
ninja --version
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Check versions of the compiler
run: |
ldd --version
gcc --version
cmake --version
- name: Get short commit hash
id: vars
run: |
echo "Git hash: $(git rev-parse --short=8 HEAD)"
echo "sha_short=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT
- name: Ensuring git hash exists (or will fail job)
if: steps.vars.outputs.sha_short == ''
run: exit 1
- name: Setup Godot build cache
uses: ./godot-engine/.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup scons
shell: bash
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
scons --version
- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Compilation (arm64)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} arch=arm64
platform: android
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Compilation (arm32)
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} arch=arm32
platform: android
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
- name: Generate Godot templates
run: |
cd platform/android/java
./gradlew generateGodotTemplates
cd ../../..
ls -l bin/
zip -r android-template.zip bin/
- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
path: ./godot-engine/android-template.zip
name: ${{ matrix.artifact-name }}
- uses: 'google-github-actions/auth@v2'
if: ${{ inputs.deploy-to-gcp }}
with:
credentials_json: '${{ secrets.GCP_BUCKET_UPLOAD }}'
- name: Upload binary
if: ${{ inputs.deploy-to-gcp }}
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: ./godot-engine/android-template.zip
destination: ${{ matrix.bucket-name }}/${{steps.vars.outputs.sha_short}}/