-
-
Notifications
You must be signed in to change notification settings - Fork 58
460 lines (409 loc) · 15.6 KB
/
gdextension.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
name: 🔌 GDExtension
on:
workflow_call:
inputs:
godot-cpp-ref:
description: A tag, branch or commit hash in the godot-cpp repository.
type: string
default: godot-4.3-stable
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
test-build:
description: Limit to pre-defined test builds
type: boolean
default: false
debug-symbols:
description: All builds with debug symbols
type: boolean
default: false
workflow_dispatch:
inputs:
godot-cpp-ref:
description: A tag, branch or commit hash in the godot-cpp repository.
type: string
default: godot-4.3-stable
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
test-build:
description: Limit to pre-defined test builds
type: boolean
default: false
debug-symbols:
description: All builds with debug symbols
type: boolean
default: false
# Global Settings
env:
SCONS_CACHE_LIMIT: 4096
SCONSFLAGS: dev_build=no verbose=yes
EM_VERSION: 3.1.45
GODOT_VERSION: 4.3-stable
jobs:
gdextension:
runs-on: ${{ matrix.opts.runner }}
name: ${{ matrix.opts.name }}
outputs:
name-prefix: ${{ steps.output-name-prefix.outputs.name-prefix }}
strategy:
fail-fast: false
matrix:
opts:
- name: 🐧 Linux (x86_64, release)
runner: ubuntu-20.04
platform: linux
target: template_release
arch: x86_64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.linux.template_release.x86_64.so
should-build: true
- name: 🐧 Linux (x86_64, debug)
runner: ubuntu-20.04
platform: linux
target: editor
arch: x86_64
debug-symbols: true
bin: liblimboai.linux.editor.x86_64.so
should-build: true
- name: 🪟 Windows (x86_64, release)
runner: windows-latest
platform: windows
target: template_release
arch: x86_64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.windows.template_release.x86_64.dll
should-build: true
- name: 🪟 Windows (x86_64, debug)
runner: windows-latest
platform: windows
target: editor
arch: x86_64
debug-symbols: true
bin: liblimboai.windows.editor.x86_64.dll
should-build: true
- name: 🍎 macOS (universal, release)
runner: macos-latest
platform: macos
target: template_release
arch: universal
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.macos.template_release
should-build: true
- name: 🍎 macOS (universal, debug)
runner: macos-latest
platform: macos
target: editor
arch: universal
debug-symbols: true
bin: liblimboai.macos.editor
should-build: true
- name: 🌐 Web (wasm32, release)
runner: ubuntu-20.04
platform: web
target: template_release
arch: wasm32
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.web.template_release.wasm32.wasm
should-build: ${{ !inputs.test-build }}
- name: 🌐 Web (wasm32, debug)
runner: ubuntu-20.04
platform: web
target: template_debug
arch: wasm32
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.web.template_debug.wasm32.wasm
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (arm64, release)
runner: ubuntu-20.04
platform: android
target: template_release
arch: arm64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_release.arm64.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (arm64, debug)
runner: ubuntu-20.04
platform: android
target: template_debug
arch: arm64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_debug.arm64.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (arm32, release)
runner: ubuntu-20.04
platform: android
target: template_release
arch: arm32
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_release.arm32.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (arm32, debug)
runner: ubuntu-20.04
platform: android
target: template_debug
arch: arm32
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_debug.arm32.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (x86_64, release)
runner: ubuntu-20.04
platform: android
target: template_release
arch: x86_64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_release.x86_64.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (x86_64, debug)
runner: ubuntu-20.04
platform: android
target: template_debug
arch: x86_64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_debug.x86_64.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (x86_32, release)
runner: ubuntu-20.04
platform: android
target: template_release
arch: x86_32
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_release.x86_32.so
should-build: ${{ !inputs.test-build }}
- name: 🤖 Android (x86_32, debug)
runner: ubuntu-20.04
platform: android
target: template_debug
arch: x86_32
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.android.template_debug.x86_32.so
should-build: ${{ !inputs.test-build }}
- name: 🍏 iOS (arm64, release)
runner: macos-latest
platform: ios
target: template_release
arch: arm64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.ios.template_release.arm64.dylib
should-build: ${{ !inputs.test-build }}
- name: 🍏 iOS (arm64, debug)
runner: macos-latest
platform: ios
target: template_debug
arch: arm64
debug-symbols: ${{ inputs.debug-symbols }}
bin: liblimboai.ios.template_debug.arm64.dylib
should-build: ${{ !inputs.test-build }}
- name: 🍏 iOS (simulator, release)
runner: macos-latest
platform: ios
target: template_release
arch: universal
debug-symbols: ${{ inputs.debug-symbols }}
scons-flags: ios_simulator=yes
bin: liblimboai.ios.template_release.universal.simulator.dylib
should-build: ${{ !inputs.test-build }}
- name: 🍏 iOS (simulator, debug)
runner: macos-latest
platform: ios
target: template_debug
arch: universal
debug-symbols: ${{ inputs.debug-symbols }}
scons-flags: ios_simulator=yes
bin: liblimboai.ios.template_debug.universal.simulator.dylib
should-build: ${{ !inputs.test-build }}
exclude:
- { opts: { should-build: false } }
steps:
- name: Clone LimboAI module
uses: actions/checkout@v4
with:
fetch-tags: true
ref: ${{ inputs.limboai-ref }}
- name: Clone godot-cpp
uses: actions/checkout@v4
with:
repository: godotengine/godot-cpp
fetch-tags: true
path: godot-cpp
ref: ${{ inputs.godot-cpp-ref }}
# Inits GDEXTENSION_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./.github/actions/init-version-gdext
- name: Output NAME_PREFIX
id: output-name-prefix
run: echo "name-prefix=${NAME_PREFIX}" >> $GITHUB_OUTPUT
- name: Setup Linux toolchain
if: matrix.opts.platform == 'linux'
uses: ./.github/actions/setup-linux-toolchain
with:
arch: ${{matrix.opts.arch}}
- name: Set up Python 3.x
if: matrix.opts.platform == 'windows' || matrix.opts.platform == 'macos'
uses: actions/setup-python@v5
with:
python-version: "3.x"
architecture: "x64"
- name: Set up Emscripten (Web)
if: matrix.opts.platform == 'web'
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
no-cache: true
- name: Verify Emscripten setup (Web)
if: matrix.opts.platform == 'web'
run: |
emcc -v
- name: Set up scons
if: matrix.opts.platform != 'linux'
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
python --version
scons --version
- name: Set up Java 17 (Android)
if: matrix.opts.platform == 'android'
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: nttld/setup-ndk@v1
if: matrix.opts.platform == 'android'
id: setup-ndk
with:
ndk-version: r23c
link-to-sdk: true
- name: Set up MSVC problem matcher (Windows)
if: matrix.opts.platform == 'windows'
uses: ammaraskar/msvc-problem-matcher@1ebcb382869bfdc2cc645e8a2a43b6d319ea1cc0 # 0.3.0
- name: Set up GCC problem matcher (Linux)
if: matrix.opts.platform == 'linux'
uses: ammaraskar/gcc-problem-matcher@0f9c86f9e693db67dacf53986e1674de5f2e5f28 # 0.3.0
- name: Set up scons cache
if: inputs.test-build # ! Only cache test/PR builds
uses: actions/cache@v4
with:
path: ${{github.workspace}}/.scons_cache/
key: ${{matrix.opts.bin}}-${{matrix.opts.debug-symbols}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
restore-keys: |
${{matrix.opts.bin}}-${{matrix.opts.debug-symbols}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
${{matrix.opts.bin}}-${{matrix.opts.debug-symbols}}-${{inputs.godot-cpp-ref}}-${{inputs.limboai-ref}}
${{matrix.opts.bin}}-${{matrix.opts.debug-symbols}}-${{inputs.godot-cpp-ref}}
- name: Compilation
shell: bash
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
DEBUG_FLAGS: ${{ matrix.opts.debug-symbols && 'debug_symbols=yes symbols_visibility=visible' || 'debug_symbols=no' }}
run: |
PATH=${GITHUB_WORKSPACE}/buildroot/bin:$PATH
scons platform=${{matrix.opts.platform}} target=${{matrix.opts.target}} arch=${{matrix.opts.arch}} ${{env.DEBUG_FLAGS}} ${{matrix.opts.scons-flags}} ${{env.SCONSFLAGS}}
- name: Split debug symbols (Linux)
if: matrix.opts.debug-symbols && matrix.opts.platform == 'linux'
shell: bash
run: |
cd demo/addons/limboai/bin/
objcopy --only-keep-debug ${{matrix.opts.bin}} ${{matrix.opts.bin}}.debug
objcopy --add-gnu-debuglink ${{matrix.opts.bin}}.debug ${{matrix.opts.bin}}
strip --strip-debug ${{matrix.opts.bin}}
readelf --debug-dump=links ${{matrix.opts.bin}}
nm ${{matrix.opts.bin}}
- name: Split debug symbols (macOS & iOS)
if: matrix.opts.debug-symbols && (matrix.opts.platform == 'macos' || matrix.opts.platform == 'ios')
shell: bash
run: |
cd demo/addons/limboai/bin/
if [ "${{matrix.opts.platform}}" == "macos" ]; then
cd liblimboai.*.framework/
fi
dsymutil ${{matrix.opts.bin}}
strip -x ${{matrix.opts.bin}}
nm ${{matrix.opts.bin}}
- name: Prepare artifact
shell: bash
run: |
ls -R demo/addons/limboai/
mkdir out
mv demo/addons/ out/
cp {README,LICENSE,LOGO_LICENSE}.md out/addons/limboai/
cp -R demo/demo/ out/demo/
cp demo/LICENSE_ASSETS.md out/demo/
rm -f out/addons/limboai/bin/*.{exp,lib}
echo "${LIMBOAI_VERSION}" > out/addons/limboai/version.txt
echo "---"
ls -R out/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tmp-gdextension.${{matrix.opts.platform}}.${{matrix.opts.target}}.${{matrix.opts.arch}}
path: |
out/*
!out/**/*.debug
!out/**/*.pdb
!out/**/*.dSYM
- name: Upload debug symbols
if: matrix.opts.debug-symbols
uses: actions/upload-artifact@v4
with:
name: tmp-gdextension-symbols.${{matrix.opts.platform}}.${{matrix.opts.target}}.${{matrix.opts.arch}}
path: |
out/**/*.debug
out/**/*.pdb
out/**/*.dSYM
package-extension:
name: 📦 Package extension
runs-on: ubuntu-latest
needs: gdextension
steps:
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: ${{needs.gdextension.outputs.name-prefix}}
pattern: tmp-gdextension.*
delete-merged: true
- name: Merge debug symbols artifacts
uses: actions/upload-artifact/merge@v4
with:
name: ${{needs.gdextension.outputs.name-prefix}}.debug-symbols
pattern: tmp-gdextension-symbols.*
delete-merged: true
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{needs.gdextension.outputs.name-prefix}}
path: out/
- name: Setup Godot
shell: bash
run: |
echo "Downloading Godot ${GODOT_VERSION}"
mkdir bin
cd bin
wget "https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_linux.x86_64.zip" -O godot.zip
unzip godot.zip
rm godot.zip
mv Godot_* godot
chmod u+x godot
ls -l
cd ..
./bin/godot --version
- name: Generate icon .import files
shell: bash
run: |
touch out/project.godot
timeout 20s ./bin/godot --headless --editor --path ./out/ || /bin/true
rm out/project.godot
rm -rf out/.godot/
- name: Change editor icon import settings
shell: bash
run: |
echo "--- Listing icons dir:"
ls out/addons/limboai/icons/
echo "--- (end of listing)"
sed -i 's|editor/scale_with_editor_scale=false|editor/scale_with_editor_scale=true|' out/addons/limboai/icons/*.import
sed -i 's|editor/convert_colors_with_editor_theme=false|editor/convert_colors_with_editor_theme=true|' out/addons/limboai/icons/*.import
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{needs.gdextension.outputs.name-prefix}}
path: out/*
overwrite: true