-
Notifications
You must be signed in to change notification settings - Fork 1
323 lines (285 loc) · 11.8 KB
/
builds.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
name: V-Sekai Builds
on:
push:
branches:
- main
tags:
- "*"
pull_request:
env:
GAME_NAME: vsekai_goal_plan_
GODOT_REF: groups-4.2.2023-11-29T013556Z
GODOT_REPOSITORY: v-sekai/godot
SCONSFLAGS: verbose=yes warnings=extra werror=no module_text_server_fb_enabled=yes use_thinlto=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
EM_VERSION: 3.1.18
EM_CACHE_FOLDER: "emsdk-cache"
concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-deploy
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.runs-on }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: linux_editor_win_deploy
runs-on: ubuntu-22.04
cache-name: linux-editor-deploy-windows-editor
target: editor
tests: false
sconsflags: linker=gold precision=double use_mingw=yes
doc-test: false
bin: ./godot/bin/godot.linuxbsd.editor.double.x86_64
deploy-bin: ./godot/bin/godot.windows.editor.double.x86_64.exe
editor-bin-name: godot.windows.editor.double.x86_64.exe
proj-conv: false
artifact: true
platform: linuxbsd
deploy: true
deploy-pdb: true
deploy-platform: windows
export-platform: Windows
arch: _x86_64
deploy-platform-target: editor
- name: linux_editor_linux_deploy
runs-on: ubuntu-22.04
cache-name: linux-editor-deploy-linux-editor
target: editor
tests: false
sconsflags: linker=gold precision=double use_llvm=yes
doc-test: false
bin: ./godot/bin/godot.linuxbsd.editor.double.x86_64.llvm
deploy-bin: ./godot/bin/godot.linuxbsd.editor.double.x86_64.llvm
editor-bin-name: godot.linuxbsd.editor.double.x86_64.llvm
proj-conv: false
artifact: true
platform: linuxbsd
deploy: true
deploy-platform: linux
export-platform: Linux
arch: _x86_64
deploy-platform-target: editor
- name: macos_editor_macos_deploy
runs-on: "macos-latest"
cache-name: macos-editor-deploy-macos-editor
target: editor
tests: false
sconsflags: linker=gold precision=double
doc-test: false
bin: ./godot/bin/godot.macos.editor.double.x86_64
deploy-bin: ./godot/bin/godot.macos.editor.double.x86_64
editor-bin-name: godot.macos.editor.double.x86_64
proj-conv: false
artifact: true
platform: macos
deploy: true
deploy-platform: macos
export-platform: Mac
arch: _x86_64
deploy-platform-target: editor
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3.5.2
- name: Linux dependencies for gold linker
if: ${{ matrix.platform == 'linux' }}
run: |
sudo apt-get install -qq binutils
shell: bash
- name: Install MinGW
if: ${{ matrix.deploy-platform == 'windows' }}
run: |
sudo add-apt-repository ppa:savoury1/build-tools
sudo apt-get update
sudo apt-get install mingw-w64
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
shell: bash
- name: Setup Godot build cache
uses: ./.github/actions/godot-cache
with:
cache-name: ${{ matrix.cache-name }}
continue-on-error: true
- name: Setup Vulkan SDK
if: ${{ matrix.platform == 'macos' }}
run: |
sh ./.github/install_vulkan_sdk_macos.sh
- name: Set up Emscripten latest
if: ${{ matrix.platform == 'web' || matrix.deploy-platform == 'web'}}
uses: mymindstorm/setup-emsdk@d233ac12b0102f74ca199f5dad7a4e2c13a8a745 # v13
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Verify Emscripten setup
if: ${{ matrix.platform == 'web' || matrix.deploy-platform == 'web'}}
run: |
emcc -v
shell: bash
- name: Setup python, scons and golang
uses: ./.github/actions/godot-deps
with:
godot-ref: ${{ env.GODOT_REF }}
godot-repository: ${{ env.GODOT_REPOSITORY }}
- name: Set up .NET Sdk
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
if: ${{ matrix.build-mono }}
with:
dotnet-version: "6.0.x"
- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@d1fed1fac9e94d30e23b5a82dba4e2963e71d2e7 # master
- name: Compilation
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: ${{ matrix.platform }}
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
deploy: ${{ matrix.deploy }}
deploy-platform: ${{ matrix.deploy-platform }}
deploy-platform-target: ${{ matrix.deploy-platform-target }}
- name: Compilation
if: ${{ matrix.deploy-platform == 'windows' || matrix.deploy-platform == 'web' }}
uses: ./.github/actions/godot-build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
platform: ${{ matrix.platform }}
target: ${{ matrix.target }}
tests: false
deploy: false
deploy-platform: ${{ matrix.platform }}
deploy-platform-target: ${{ matrix.target }}
- name: Generate build constants
uses: ./.github/actions/vsk-generate-constants
- name: Export Game
if: ${{ matrix.deploy }}
run: |
mkdir -p .godot/editor .godot/imported export_${{ matrix.deploy-platform }}
chmod +x ${{ matrix.bin }}
${{ matrix.bin }} --headless --xr-mode off --export-pack ${{ matrix.export-platform }} `pwd`/${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck --path . || true
timeout-minutes: 10
shell: bash
- name: Prepare artifacts
if: ${{ matrix.deploy }}
run: |
ls
# Check if the .pck file exists
if [ ! -f ./${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck ]; then
echo "Error: ${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck does not exist."
exit 1
fi
# Check if the path to the .pck file is correct
if [ ! -f `pwd`/${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck ]; then
echo "Error: The path to ${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck is incorrect."
exit 1
fi
rm -rf ${{ env.GAME_NAME }}${{ matrix.deploy-platform }}
export TARGET=${{ env.GAME_NAME }}${{ matrix.deploy-platform }}
mkdir -p $TARGET
# If deploy platform is windows, append .exe to the binary
if [ "${{ matrix.deploy-platform }}" == "windows" ]; then
cp -rf ${{ matrix.deploy-bin }} $TARGET/${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.exe
else
cp -rf ${{ matrix.deploy-bin }} $TARGET/${{ env.GAME_NAME }}${{ matrix.deploy-platform }}
fi
cp -rf `pwd`/${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck $TARGET/${{ env.GAME_NAME }}${{ matrix.deploy-platform }}.pck
7z a -r $TARGET.zip $TARGET
shell: bash
- name: Upload Godot Artifact Export
if: ${{ matrix.deploy }}
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: ${{ env.GAME_NAME }}${{ matrix.deploy-platform }}
path: |
${{ env.GAME_NAME }}${{ matrix.deploy-platform }}
- name: Generate C# glue
if: ${{ matrix.build-mono }}
run: |
${{ matrix.bin }} --headless --generate-mono-glue ./modules/mono/glue || true
shell: bash
- name: Build .NET solutions
if: ${{ matrix.build-mono }}
run: |
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd
shell: bash
- name: Unit tests
if: ${{ matrix.tests }}
run: |
${{ matrix.bin }} --version
${{ matrix.bin }} --help
${{ matrix.bin }} --test --headless
shell: bash
- name: Check for class reference updates
if: ${{ matrix.doc-test }}
run: |
echo "Running --doctool to see if this changes the public API without updating the documentation."
echo -e "If a diff is shown, it means that your code/doc changes are incomplete and you should update the class reference with --doctool.\n\n"
${{ matrix.bin }} --doctool --headless 2>&1 > /dev/null || true
git diff --color --exit-code && ! git ls-files --others --exclude-standard | sed -e 's/^/New doc file missing in PR: /' | grep 'xml$'
shell: bash
- name: Test project converter
if: ${{ matrix.proj-conv }}
run: |
mkdir -p converter_test
cd converter_test
touch project.godot
${{ matrix.bin }} --headless --validate-conversion-3to4
cd ..
rm converter_test -rf
shell: bash
- name: Prepare artifact
if: ${{ matrix.artifact }}
run: |
chmod +x godot/bin/godot.* || true
shell: bash
- name: Upload artifact
uses: ./.github/actions/upload-artifact
if: ${{ matrix.artifact }}
with:
name: ${{ matrix.cache-name }}
release:
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- name: Download Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- name: List files
run: |
ls -R ${{ env.GAME_NAME }}windows${{ matrix.arch }}
ls -R ${{ env.GAME_NAME }}linux${{ matrix.arch }}
ls -R linux-editor-deploy-windows-editor
ls -R linux-editor-deploy-linux-editor
ls -R macos-editor-deploy-macos-editor
shell: bash
- name: Archive files
run: |
zip -r ${{ env.GAME_NAME }}windows${{ matrix.arch }}.zip ${{ env.GAME_NAME }}windows${{ matrix.arch }}
zip -r ${{ env.GAME_NAME }}linux${{ matrix.arch }}.zip ${{ env.GAME_NAME }}linux${{ matrix.arch }}
zip -r linux-editor-deploy-windows-editor.zip linux-editor-deploy-windows-editor
zip -r linux-editor-deploy-linux-editor.zip linux-editor-deploy-linux-editor
zip -r macos-editor-deploy-macos-editor.zip macos-editor-deploy-macos-editor
- name: Create and Upload Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
files: |
${{ env.GAME_NAME }}windows${{ matrix.arch }}.zip
${{ env.GAME_NAME }}linux${{ matrix.arch }}.zip
linux-editor-deploy-windows-editor.zip
linux-editor-deploy-linux-editor.zip
macos-editor-deploy-macos-editor.zip
generate_release_notes: true
draft: false
prerelease: true
append_body: true
env:
GITHUB_TOKEN: ${{ secrets.VSEKAI_GITHUB_TOKEN }}