-
-
Notifications
You must be signed in to change notification settings - Fork 55
158 lines (136 loc) · 5.36 KB
/
web.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
name: 🌐 Web builds
on:
workflow_call:
inputs:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
workflow_dispatch:
inputs:
godot-ref:
description: A tag, branch or commit hash in the Godot repository.
type: string
default: master
limboai-ref:
description: A tag, branch or commit hash in the LimboAI repository.
type: string
default: master
# Global Settings
env:
SCONS_CACHE_LIMIT: 4096
# With `lto=full` VM seems to run out of ram and build fails
SCONSFLAGS: use_static_cpp=yes debug_symbols=no lto=thin optimize=size verbose=yes warnings=extra werror=yes tests=no
EM_VERSION: 3.1.45
EM_CACHE_FOLDER: "emsdk-cache"
jobs:
web-builds:
runs-on: "ubuntu-20.04"
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: Template (release)
target: template_release
threads: true
dlink: false
- name: Template (release, dlink)
target: template_release
threads: true
dlink: true
- name: Template (debug)
target: template_debug
threads: true
dlink: false
- name: Template (debug, dlink)
target: template_debug
threads: true
dlink: true
- name: Template (release, nothreads)
target: template_release
threads: false
dlink: false
- name: Template (release, nothreads, dlink)
target: template_release
threads: false
dlink: true
- name: Template (debug, nothreads)
target: template_debug
threads: false
dlink: false
- name: Template (debug, nothreads, dlink)
target: template_debug
threads: false
dlink: true
env:
CACHE_NAME: godot.web.${{matrix.target}}${{ matrix.dlink == true && '.dlink' || '' }}
steps:
- name: Clone Godot
uses: actions/checkout@v4
with:
repository: godotengine/godot
ref: ${{ inputs.godot-ref }}
- name: Clone LimboAI module
uses: actions/checkout@v4
with:
path: modules/limboai
ref: ${{ inputs.limboai-ref }}
# Inits GODOT_VERSION, LIMBOAI_VERSION and NAME_PREFIX environment variables.
- uses: ./modules/limboai/.github/actions/init-version
- name: Set up Emscripten cache
uses: actions/cache@v4
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{runner.os}}-libs
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Verify Emscripten setup
run: |
emcc -v
- name: Set up scons
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons==4.4.0
python --version
scons --version
# ! Note: we stopped using the scons cache in release builds.
# - name: Set up scons cache
# uses: actions/cache@v4
# with:
# path: ${{github.workspace}}/.scons_cache/
# key: ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# restore-keys: |
# ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}-${{env.LIMBOAI_VERSION}}
# ${{env.CACHE_NAME}}-${{inputs.godot-ref}}-${{inputs.limboai-ref}}
# ${{env.CACHE_NAME}}-${{inputs.godot-ref}}
- name: Compilation
env:
SCONS_CACHE: ${{github.workspace}}/.scons_cache/
run: |
scons platform=web target=${{matrix.target}} threads=${{matrix.threads}} dlink_enabled=${{matrix.dlink}} ${{env.SCONSFLAGS}}
- name: Prepare artifacts
run: |
mkdir -p out/templates/
mv bin/godot.web.template_debug.wasm32.zip out/templates/web_debug.zip || true
mv bin/godot.web.template_debug.wasm32.nothreads.zip out/templates/web_nothreads_debug.zip || true
mv bin/godot.web.template_debug.wasm32.dlink.zip out/templates/web_dlink_debug.zip || true
mv bin/godot.web.template_debug.wasm32.nothreads.dlink.zip out/templates/web_dlink_nothreads_debug.zip || true
mv bin/godot.web.template_release.wasm32.zip out/templates/web_release.zip || true
mv bin/godot.web.template_release.wasm32.nothreads.zip out/templates/web_nothreads_release.zip || true
mv bin/godot.web.template_release.wasm32.dlink.zip out/templates/web_dlink_release.zip || true
mv bin/godot.web.template_release.wasm32.nothreads.dlink.zip out/templates/web_dlink_nothreads_release.zip || true
rm -rf bin/
echo "${GODOT_VERSION}.limboai+${LIMBOAI_VERSION}" > out/templates/version.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.NAME_PREFIX}}.${{matrix.target}}.web${{matrix.threads == false && '.nothreads' || ''}}${{matrix.dlink == true && '.dlink' || ''}}
path: out/*