-
Notifications
You must be signed in to change notification settings - Fork 10
403 lines (367 loc) · 11.3 KB
/
ci.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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
windows:
name: Windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-2019
- windows-2022
arch:
- win32
- win64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: seanmiddleditch/gha-setup-ninja@master
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- if: matrix.arch == 'win64'
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://github.com/blitz3d-ng/env/releases/download/v7/llvm-17.0.5-win64-msvc$env:VisualStudioVersion.zip" -OutFile "llvm.zip"
Expand-Archive llvm.zip -DestinationPath .\
- run: .\make.bat release
# we're gonna upload this now so it's not contaminated with the mesa
# files
- name: Upload toolchain and package
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.arch }}-${{ matrix.os }}
path: |
_release/bin
_release/*.exe
- name: Install dummy sound card
shell: pwsh
run: |
Start-Service audio*
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/3.6/Scream3.6.zip -OutFile C:\Scream3.6.zip
Extract-7Zip -Path C:\Scream3.6.zip -DestinationPath C:\Scream
$cert = (Get-AuthenticodeSignature C:\Scream\Install\driver\Scream.sys).SignerCertificate
$store = [System.Security.Cryptography.X509Certificates.X509Store]::new("TrustedPublisher", "LocalMachine")
$store.Open("ReadWrite")
$store.Add($cert)
$store.Close()
cd C:\Scream\Install\driver
C:\Scream\Install\helpers\devcon install Scream.inf *Scream
- name: Install mesa
shell: pwsh
run: |
Invoke-WebRequest https://github.com/pal1000/mesa-dist-win/releases/download/23.0.0/mesa3d-23.0.0-release-msvc.7z -OutFile mesa3d.7z
Extract-7Zip -Path mesa3d.7z -DestinationPath mesa
cp mesa\$env:platform\*.dll _release\bin\
ls _release\bin
- name: Test suite
shell: pwsh
run: |
$env:blitzpath='_release'
.\test\suite.bat
mingw:
name: MinGW
runs-on: ubuntu-20.04 # ubuntu-latest is missing some sound modules
strategy:
matrix:
arch:
- mingw32
- mingw64
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./env.sh mingw make ENV=release PLATFORM=${{ matrix.arch }}
# - run: ./env.sh mingw sh ./test/entry.mingw32.sh
# continue-on-error: true
macos:
name: macOS
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-11
- macos-12
- macos-13
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: |
mkdir _release/toolchains
wget https://github.com/blitz3d-ng/env/releases/download/v7/llvm-17.0.5-${{ matrix.os }}.zip
unzip llvm-17.0.5-${{ matrix.os }}.zip
- run: brew install ninja gcovr
- run: make ENV=release PLATFORM=macos LLVM_ROOT=$GITHUB_WORKSPACE/llvm
- run: blitzpath=$GITHUB_WORKSPACE/_release ./test/suite.sh
- name: Upload toolchain and package
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: |
_release/bin
_release/*.app
linux:
name: Linux
runs-on: ubuntu-20.04 # ubuntu-latest is missing some sound modules
strategy:
matrix:
dist:
- debian-10
- debian-11
- ubuntu-20.04
- ubuntu-22.04
steps:
- name: Install dummy sound card
run: |
sudo apt-get install -y linux-sound-base linux-modules-extra-`uname -r`
sudo modprobe snd-dummy
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./env.sh ${{ matrix.dist }} make ENV=release PLATFORM=linux
- run: ./env.sh ${{ matrix.dist }} ./test/suite.sh
ios:
name: iOS
runs-on: macos-12
strategy:
matrix:
device:
- ios
- ios-sim
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: |
mkdir _release/toolchains
wget https://github.com/blitz3d-ng/env/releases/download/v7/llvm-17.0.5-macos-12.zip
unzip llvm-17.0.5-macos-12.zip
- run: brew install ninja gcovr
- run: make compiler
- run: make ENV=release PLATFORM=${{ matrix.device }}
- run: blitzpath=$GITHUB_WORKSPACE/_release ./test/suite.sh ${{ matrix.device }}
- name: Upload toolchain and package
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.device }}
path: _release/bin
android:
name: Android
runs-on: ubuntu-latest
strategy:
matrix:
arch:
- arm64-v8a
- armeabi-v7a
- "x86"
- "x86_64"
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./env.sh android make compiler
- run: ./env.sh android make ENV=release PLATFORM=android ARCH=${{ matrix.arch }}
- run: ./env.sh android ./test/suite.sh ${{ matrix.arch }}-android-30
- name: Upload toolchain and package
uses: actions/upload-artifact@v3
with:
name: android-${{ matrix.arch }}
path: _release/bin
ovr:
name: OVR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./env.sh android make ovr
- run: ./env.sh android ./test/suite.sh ovr
- name: Upload toolchain and package
uses: actions/upload-artifact@v3
with:
name: ovr-${{ matrix.arch }}
path: _release/bin
emscripten:
name: Emscripten (Web)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./env.sh emscripten make emscripten
nx:
name: Switch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: ./env.sh nx make compiler
- run: ./env.sh nx make ENV=release PLATFORM=nx
help:
name: Help
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: ruby/setup-ruby@v1
with:
working-directory: src/help
bundler-cache: true
- run: make help
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: help
path: _release/help
package_windows:
name: Build Windows Package
runs-on: ubuntu-latest
needs:
- windows
steps:
- uses: actions/checkout@v3
- name: Get tag name
run: |
export GITHUB_TAG=$([ $GITHUB_REF_NAME = "master" ] && echo "edge" || (echo $GITHUB_REF_NAME | tr / -))
echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV
- run: rm -rf _release/help
- name: Download help
uses: actions/download-artifact@v3
with:
name: help
path: _release/help
- name: Download win32
uses: actions/download-artifact@v3
with:
name: win32-windows-2022
path: _release
- name: Download win64
uses: actions/download-artifact@v3
with:
name: win64-windows-2022
path: _release
- name: Create Windows package
run: |
make dist-pkg
mv package.zip blitz3d-ng-${{ env.GITHUB_TAG }}-windows.zip
git clean -xfd _release
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: windows-package
path: "*.zip"
package_macos:
name: Build macOS Package
runs-on: ubuntu-latest
strategy:
matrix:
version:
- 11
- 12
- 13
needs:
- macos
- ios
steps:
- uses: actions/checkout@v3
- name: Get tag name
run: |
export GITHUB_TAG=$([ $GITHUB_REF_NAME = "master" ] && echo "edge" || (echo $GITHUB_REF_NAME | tr / -))
echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV
- run: rm -rf _release/help
- name: Download help
uses: actions/download-artifact@v3
with:
name: help
path: _release/help
- name: Download macos-${{ matrix.version }}
uses: actions/download-artifact@v3
with:
name: macos-${{ matrix.version }}
path: _release
- name: Download ios
uses: actions/download-artifact@v3
with:
name: ios
path: _release
- name: Download ios-sim
uses: actions/download-artifact@v3
with:
name: ios-sim
path: _release
- name: Create package
run: |
make dist-pkg
mv package.zip blitz3d-ng-${{ env.GITHUB_TAG }}-macos${{ matrix.version }}.zip
git clean -xfd _release
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.version }}-package
path: "*.zip"
release:
name: Build release
runs-on: ubuntu-latest
needs:
- help
- package_windows
- package_macos
- linux
- android
- ovr
- emscripten
- nx
steps:
- uses: actions/checkout@v3
- name: Get tag name
run: |
export GITHUB_TAG=$([ $GITHUB_REF_NAME = "master" ] && echo "edge" || (echo $GITHUB_REF_NAME | tr / -))
echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
with:
name: windows-package
- uses: actions/download-artifact@v3
with:
name: macos-11-package
- run: TAG=$GITHUB_TAG MACOS=macos11 file=\$file ARCHIVE=\$ARCHIVE envsubst < src/download.macos.sh > blitz3d-ng-$GITHUB_TAG-macos11.sh
- uses: actions/download-artifact@v3
with:
name: macos-12-package
- run: TAG=$GITHUB_TAG MACOS=macos12 file=\$file ARCHIVE=\$ARCHIVE envsubst < src/download.macos.sh > blitz3d-ng-$GITHUB_TAG-macos12.sh
- uses: actions/download-artifact@v3
with:
name: macos-13-package
- run: TAG=$GITHUB_TAG MACOS=macos13 file=\$file ARCHIVE=\$ARCHIVE envsubst < src/download.macos.sh > blitz3d-ng-$GITHUB_TAG-macos13.sh
- name: Versioned Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ contains(github.ref, 'beta') }}
generate_release_notes: false
files: |
*.zip
*.sh
- name: Edge Release
if: github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v1
with:
name: Latest Build
tag_name: edge
prerelease: true
generate_release_notes: false
body: |
This is the latest code based on the master branch. It should generally
work, but has not been manually tested. Use with caution.
files: |
*.zip
*.sh