-
Notifications
You must be signed in to change notification settings - Fork 30
264 lines (225 loc) · 7.74 KB
/
build-engine.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
name: 'Build engine'
on:
push:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'gamedata/**'
- 'sdk/**'
- 'src/**'
- '**/CMakeLists.txt'
- '**/*.ltx'
- '**/*.json'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'gamedata/**'
- 'sdk/**'
- 'src/**'
- '**/CMakeLists.txt'
- '**/*.ltx'
- '**/*.json'
defaults:
run:
shell: pwsh
jobs:
build-engine:
name: 'Build engine'
strategy:
matrix:
system:
- windows-2022
preset:
- Engine
platform:
- x64
config:
- Debug
- RelWithDebInfo
- Release
runs-on: ${{ matrix.system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache packages
uses: actions/cache@v4
with:
key: ${{ matrix.preset }}-NuGet-${{ hashFiles('**/Packages.config') }}
restore-keys: |
${{ matrix.preset }}-NuGet-${{ hashFiles('**/Packages.config') }}
${{ matrix.preset }}-NuGet-
path: |
~/.nuget/packages
- name: Configure engine
run: |
cmake --preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }}
- name: Build engine
run: |
cmake --build --preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }}-${{ matrix.config }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: engine-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.exe
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.dll
- name: Upload symbols
uses: actions/upload-artifact@v4
if: ${{ matrix.config != 'Release' }}
with:
name: engine-symbols-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb
- name: Upload libraries
uses: actions/upload-artifact@v4
with:
name: engine-libraries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/lib/${{ matrix.config }}/
- name: Upload packages
uses: actions/upload-artifact@v4
if: ${{ (matrix.config == 'Debug' && matrix.platform == 'x64') }}
with:
name: engine-packages-${{ matrix.system }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/packages/
build-compressor:
name: 'Build compressor'
strategy:
matrix:
system:
- windows-2022
- ubuntu-22.04
preset:
- Compressor
platform:
- x64
config:
- Debug
- RelWithDebInfo
- Release
runs-on: ${{ matrix.system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Ninja
if: contains(matrix.system, 'ubuntu')
uses: imesense/[email protected]
- name: Configure compressor
run: |
cmake --preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }}
- name: Build compressor
run: |
cmake --build --preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }}-${{ matrix.config }}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: compressor-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/
!build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb
!build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.debug
if-no-files-found: ignore
- name: Upload symbols
uses: actions/upload-artifact@v4
if: ${{ matrix.config != 'Release' }}
with:
name: compressor-symbols-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.debug
if-no-files-found: ignore
- name: Upload libraries
uses: actions/upload-artifact@v4
with:
name: compressor-libraries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/lib/${{ matrix.config }}/
if-no-files-found: ignore
pack-assets:
name: 'Pack assets'
needs: build-compressor
strategy:
matrix:
system:
- windows-2022
preset:
- Compressor
platform:
- x64
config:
- Release
runs-on: ${{ matrix.system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get compressor
uses: actions/download-artifact@v4
with:
name: compressor-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/
- name: Generate patch
run: |
${{ github.workspace }}/util/generate-patch.bat
type *.log
move ${{ github.workspace }}/gamedata ${{ github.workspace }}/gamedata_full
move ${{ github.workspace }}/patch ${{ github.workspace }}/gamedata
- name: Upload assets
uses: actions/upload-artifact@v4
with:
name: compressor-assets-${{ github.sha }}
path: |
gamedata/
patches/xpatch_03.db
fsgame.ltx
.xrignore
publish-engine:
name: 'Publish engine'
needs:
- build-engine
- pack-assets
strategy:
matrix:
system:
- windows-2022
platform:
- x64
preset:
- Engine
config:
- RelWithDebInfo
runs-on: ${{ matrix.system }}
steps:
- name: Get engine
uses: actions/download-artifact@v4
with:
name: engine-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }}
path: build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/
- name: Get assets
uses: actions/download-artifact@v4
with:
name: compressor-assets-${{ github.sha }}
path: ./
- name: Move files
run: |
mkdir ${{ github.workspace }}/bin
move ${{ github.workspace }}/build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.* ${{ github.workspace }}/bin
- name: Upload engine
uses: actions/upload-artifact@v4
with:
name: engine-publish-${{ matrix.system }}-${{ matrix.platform }}-${{ github.sha }}
path: |
bin/
gamedata/
patches/xpatch_03.db
fsgame.ltx
.xrignore