-
Notifications
You must be signed in to change notification settings - Fork 11
187 lines (160 loc) · 4.67 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
name: 'Build engine'
on:
push:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'gamedata/**'
- 'proj/**'
- 'sdk/**'
- 'src/**'
- '*.sln'
- '*.props'
- '*.targets'
- '*.ltx'
- '*.bat'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'gamedata/**'
- 'proj/**'
- 'sdk/**'
- 'src/**'
- '*.sln'
- '*.props'
- '*.targets'
- '*.ltx'
- '*.bat'
defaults:
run:
shell: pwsh
jobs:
build-engine:
name: 'Build'
strategy:
matrix:
system:
- windows-2022
config:
- Debug
- Mixed
- Release
platform:
- x86
runs-on: ${{ matrix.system }}
env:
solution_name: XRay.sln
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-version: '>=5'
- name: Cache dependencies
uses: actions/cache@v3
id: cache
with:
path: |
${{ github.workspace }}/packages
key: |
${{ runner.os }}-nuget-${{ hashFiles('**/*.nupkg') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
nuget restore $env:solution_name
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Build solution
run: |
msbuild $env:solution_name `
-p:Configuration=${{ matrix.config }} `
-p:Platform=${{ matrix.platform }} `
-maxCpuCount `
-nologo
- name: Upload engine binaries
uses: actions/upload-artifact@v3
with:
name: bin-engine-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: |
bin/Win32/${{ matrix.config }}/*.exe
bin/Win32/${{ matrix.config }}/*.dll
- name: Upload server binaries
uses: actions/upload-artifact@v3
with:
name: bin-dedicated-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: |
bin/dedicated/Win32/${{ matrix.config }}/*.exe
bin/dedicated/Win32/${{ matrix.config }}/*.dll
- name: Upload utilities binaries
uses: actions/upload-artifact@v3
with:
name: bin-utils-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: |
bin/utils/Win32/${{ matrix.config }}/*.exe
bin/utils/Win32/${{ matrix.config }}/*.dll
- name: Upload engine libraries
uses: actions/upload-artifact@v3
with:
name: lib-engine-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: |
lib/Win32/${{ matrix.config }}/*.lib
lib/Win32/${{ matrix.config }}/*.exp
- name: Upload server libraries
uses: actions/upload-artifact@v3
with:
name: lib-dedicated-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: |
lib/dedicated/Win32/${{ matrix.config }}/*.lib
lib/dedicated/Win32/${{ matrix.config }}/*.exp
- name: Upload utilities libraries
uses: actions/upload-artifact@v3
with:
name: lib-utils-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: |
lib/utils/Win32/${{ matrix.config }}/*.lib
lib/utils/Win32/${{ matrix.config }}/*.exp
pack-assets:
name: 'Pack'
needs: build-engine
strategy:
matrix:
system:
- windows-2022
config:
- Release
platform:
- x86
runs-on: ${{ matrix.system }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get binaries
uses: actions/download-artifact@v3
with:
name: bin-utils-(${{ matrix.platform }}-${{ matrix.config }})-(${{ github.sha }})
path: bin/utils/Win32/${{ matrix.config }}/
- name: Generate patch
run: |
${{ github.workspace }}/generate-patch.bat
move ${{ github.workspace }}/patch `
${{ github.workspace }}/temp/gamedata
- name: Upload gamedata
uses: actions/upload-artifact@v3
with:
name: gamedata-(${{ github.sha }})
path: temp/gamedata/
- name: Upload patch
uses: actions/upload-artifact@v3
with:
name: patch-(${{ github.sha }})
path: patches/xpatch_11.db