-
-
Notifications
You must be signed in to change notification settings - Fork 122
484 lines (418 loc) · 19.1 KB
/
Copy pathexport-optimized.yml
File metadata and controls
484 lines (418 loc) · 19.1 KB
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
name: export-optimized
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PROJECT_NAME: GodSVG
VERSION_NAME: 1.0-alpha16
# Which Godot version to use for exporting (e.g., 4.4.1, 4.5)
GODOT_VERSION: 4.6
# Which Godot release to use for exporting (e.g., stable, dev5, rc2)
GODOT_RELEASE_TYPE: stable
# Commit hash (found in Github releases)
GODOT_COMMIT_HASH: 89cea143987d564363e15d207438530651d943ac
# Emscripten version. Should normally be "latest", but if this causes problems, see what Godot itself is using.
EMSDK_VERSION: 4.0.11
# deprecated=no disables deprecated Godot features, which exist for compat and we don't use.
# d3d12=no, vulkan=no, use_volk=no since we use Compatibility Renderer. TODO disable rendering_device too (Godot issue #103100).
# disable_3d=yes since we don't use 3D features. This automatically disables 3D physics, 3D navigation, and XR.
# disable_physics_2d=yes since we don't use physics.
# disable_navigation_2d=yes since we don't use navigation.
# graphite=no I'm not sure why we have disabled, but it's a font-shaping engine.
# All modules are disabled by default, except for the following:
# - gdscript, svg: Obvious.
# - jpg, webp, dds: For exporting SVGs as different formats.
# - mbedtls: needed for HTTP requests.
# - text_server_adv: Currently unneeded, but needed for languages like Arabic.
# - freetype: Something about font rendering.
# build_profile disables a lot of unused classes.
BUILD_OPTIONS: target=template_release lto=full production=yes deprecated=no minizip=no d3d12=no vulkan=no use_volk=no disable_3d=yes disable_physics_2d=yes disable_navigation_2d=yes modules_enabled_by_default=no module_freetype_enabled=yes module_gdscript_enabled=yes module_svg_enabled=yes module_jpg_enabled=yes module_webp_enabled=yes module_dds_enabled=yes module_text_server_adv_enabled=yes graphite=no module_mbedtls_enabled=yes build_profile=../godsvg/.github/disabled_classes.gdbuild
# Links
GODOT_REPO: https://github.com/godotengine/godot.git
ANGLE_DOWNLOAD_BASE_URL: https://github.com/godotengine/godot-angle-static/releases/download/chromium%2F6601.2/godot-angle-static
jobs:
build-linux:
name: Export GodSVG for Linux
# Stay one LTS before latest to increase portability of Linux artifacts.
runs-on: ubuntu-22.04
env:
PLATFORM: "Linux"
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: sudo apt install -y scons python3 libwayland-dev
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Linux
run: |
cd godot
scons p=linuxbsd arch=x86_64 ${BUILD_OPTIONS}
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/godot.linuxbsd.template_release.x86_64 ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/linux_release.x86_64
- name: Export project
run: |
cd godsvg
mkdir -p build
godot --headless --export-release "${{ env.PLATFORM }}" build/${{ env.FULL_NAME }}.x86_64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Linux.x86_64
path: godsvg/build/${{ env.FULL_NAME }}.x86_64
if-no-files-found: error
retention-days: 28
- name: Install FUSE
run: |
sudo add-apt-repository universe
# Note: libfuse2 is renamed to libfuse2t64 in Ubuntu 24.04.
sudo apt-get install appstream libfuse2
- name: Prepare AppDir for AppImage
run: |
install -Dm755 godsvg/build/${{ env.FULL_NAME }}.x86_64 AppDir/usr/bin/godsvg
install -Dm644 godsvg/no_export/distribution/com.godsvg.GodSVG.desktop -t AppDir/usr/share/applications/
install -Dm644 godsvg/no_export/distribution/com.godsvg.GodSVG.metainfo.xml -t AppDir/usr/share/metainfo/
install -Dm644 godsvg/assets/logos/icon.svg AppDir/usr/share/icons/hicolor/scalable/apps/godsvg.svg
- name: Download linuxdeploy
run: |
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
- name: Build AppImage
run: |
mkdir -p godsvg/build
./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage
env:
LDAI_UPDATE_INFORMATION: gh-releases-zsync|MewPurPur|GodSVG|latest-all|${{ env.PROJECT_NAME }}_v*-x86_64.AppImage.zsync
LDAI_OUTPUT: godsvg/build/${{ env.FULL_NAME }}.AppImage
- name: Package AppImage download
if: github.event_name == 'workflow_dispatch'
run: |
mkdir -p godsvg/dist
mkdir -p package
cp godsvg/build/${{ env.FULL_NAME }}.AppImage package/
cp godsvg/build/${{ env.FULL_NAME }}.AppImage.zsync package/
cd package
zip -q -9 -r ../godsvg/dist/${{ env.FULL_NAME }}.Linux.AppImage.zip .
- name: Upload AppImage artifact
if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Linux.AppImage
path: godsvg/build/${{ env.FULL_NAME }}.AppImage
if-no-files-found: error
retention-days: 28
- name: Upload AppImage bundle
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Linux.AppImage
path: godsvg/dist/${{ env.FULL_NAME }}.Linux.AppImage.zip
if-no-files-found: error
retention-days: 28
build-windows:
name: Export GodSVG for Windows
runs-on: ubuntu-latest
env:
PLATFORM: "Windows"
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: |
sudo apt install -y scons python3
sudo apt install -y g++-mingw-w64-x86-64-posix
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Download ANGLE Static Libraries
run: |
mkdir -p ~/angle
cd ~/angle
curl -L -o windows_x86_64.zip ${ANGLE_DOWNLOAD_BASE_URL}-x86_64-gcc-release.zip
unzip -o windows_x86_64.zip
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Windows
run: |
cd godot
scons p=windows ${BUILD_OPTIONS} angle_libs=~/angle module_astcenc_enabled=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/godot.windows.template_release.x86_64.exe ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/windows_release_x86_64.exe
- name: Export project
run: |
cd godsvg
mkdir -p build
godot --headless --export-release "Windows Desktop" build/${{ env.FULL_NAME }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Windows
path: godsvg/build/${{ env.FULL_NAME }}.exe
if-no-files-found: error
retention-days: 28
build-macos:
name: Export GodSVG for MacOS
runs-on: macos-latest
env:
PLATFORM: "macOS"
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_macos.universal.zip
unzip -a Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_macos.universal.zip
echo "~/godot-editor/Godot.app/Contents/MacOS" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: brew install scons
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for macOS (arm64 release)
run: |
godot --help
cd godot
scons p=macos arch=arm64 ${BUILD_OPTIONS}
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for macOS (x86_64 release)
run: |
cd godot
scons p=macos arch=x86_64 ${BUILD_OPTIONS}
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Combine binaries with lipo
run: |
cd godot/bin
lipo -create godot.macos.template_release.x86_64 godot.macos.template_release.arm64 -output godot.macos.template_release.universal
chmod +x *
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Prepare .app bundle
run: |
cd godot/bin
cp -r ../misc/dist/macos_template.app .
mkdir -p macos_template.app/Contents/MacOS
cp godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.universal;
chmod +x macos_template.app/Contents/MacOS/godot_macos*;
zip -q -9 -r macos.zip macos_template.app;
mkdir -p "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}"
mv macos.zip "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}"
- name: Export project
run: |
cd godsvg
mkdir -p build
godot --headless --export-release "macOS" build/${{ env.FULL_NAME }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.MacOS
path: godsvg/build/${{ env.FULL_NAME }}.zip
if-no-files-found: error
retention-days: 28
build-web:
name: Export GodSVG for Web
runs-on: ubuntu-latest
env:
PLATFORM: "Web"
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: sudo apt-get install -y scons python3
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- name: Set up Emscripten
uses: emscripten-core/setup-emsdk@v16
with:
version: ${{ env.EMSDK_VERSION }}
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Web
run: |
cd godot
scons p=web arch=wasm32 ${BUILD_OPTIONS} threads=no
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/godot.web.template_release.wasm32.nothreads.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/web_nothreads_release.zip
- name: Export project
run: |
cd godsvg
mkdir -p build/web
godot --headless --export-release "Web" build/web/${{ env.FULL_NAME }}.html
cd build/web
mv ${{ env.FULL_NAME }}.html index.html
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Web
path: godsvg/build/web
if-no-files-found: error
retention-days: 28
build-android:
name: Export GodSVG for Android
runs-on: ubuntu-latest
env:
PLATFORM: "Android"
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
- name: Set up Android SDK
uses: android-actions/setup-android@v4
- name: Check Installed Android SDK Packages
run: |
echo "Checking installed Android SDK packages..."
/usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --list_installed
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: sudo apt-get install -y scons python3
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Android
run: |
cd godot
scons p=android arch=arm32 swappy=no ${BUILD_OPTIONS} target=template_debug
scons p=android arch=arm64 swappy=no ${BUILD_OPTIONS} target=template_debug generate_apk=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/android_debug.apk ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_debug.apk
mv ./bin/android_source.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_source.zip
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot release template for Android
run: |
cd godot
scons p=android arch=arm32 swappy=no ${BUILD_OPTIONS} target=template_release
scons p=android arch=arm64 swappy=no ${BUILD_OPTIONS} target=template_release generate_apk=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/android_release.apk ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_release.apk
mv ./bin/android_source.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_source.zip
- name: Export debug project
env:
GODOT_ANDROID_KEYSTORE_DEBUG_PATH: "./no_export/debug.keystore"
GODOT_ANDROID_KEYSTORE_DEBUG_USER: "androiddebugkey"
GODOT_ANDROID_KEYSTORE_DEBUG_PASSWORD: "android"
run: |
cd godsvg
mkdir -p build/android
godot --headless --export-debug "Android" build/android/${{ env.FULL_NAME }}.Android.debug.apk
- name: Export release project
if: github.event_name == 'workflow_dispatch'
env:
GODOT_ANDROID_KEYSTORE_RELEASE_PATH: "/tmp/release.keystore"
GODOT_ANDROID_KEYSTORE_RELEASE_USER: ${{ secrets.KEY_ALIAS }}
GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: |
cd godsvg
mkdir -p build/android
echo "${{ secrets.KEYSTORE }}" | base64 -d > /tmp/release.keystore
godot --headless --export-release "Android" build/android/${{ env.FULL_NAME }}.Android.apk
- name: Upload debug artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.debug.Android
path: godsvg/build/android/${{ env.FULL_NAME }}.Android.debug.apk
if-no-files-found: error
retention-days: 28
- name: Upload release artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Android
path: godsvg/build/android/${{ env.FULL_NAME }}.Android.apk
if-no-files-found: ignore
retention-days: 28