forked from Qfusion/qfusion
-
Notifications
You must be signed in to change notification settings - Fork 45
281 lines (227 loc) · 8.94 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
build-linux64:
runs-on: ubuntu-22.04
container:
image: ubuntu:22.04
env:
DEBIAN_FRONTEND: noninteractive
DEBCONF_NONINTERACTIVE_SEEN: true
steps:
- name: Update git before checkout - https://github.com/actions/checkout/issues/335
run: |
apt update
apt install -y git
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Add safe directory - https://github.com/actions/checkout/issues/1169
run: git config --system --add safe.directory /__w/warfork-qfusion/warfork-qfusion
- name: Install build dependencies
run: |
apt update
apt install -y curl clang cmake build-essential libsdl2-dev libopenal-dev libvorbis-dev libfreetype6-dev libcurl4-gnutls-dev git zip unzip python3
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
unzip third-party/steamworks/sdk.zip -d third-party/steamworks
- name: Setup glslang
working-directory: ./source/glslang
run: |
python3 ./update_glslang_sources.py
- name: Generate makefiles
working-directory: ./source
run: |
export CC=clang CXX=clang++
cmake -DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 .
- name: Build project
working-directory: ./source
run: make -j8
- name: Package warfork
working-directory: ./source/build
run: tar -czvf ../Linux-x86_64-Release.tar.gz * --exclude *.a --exclude base*/*.a libs/*.a
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: linux-x86_64-release
path: source/Linux-x86_64-Release.tar.gz
build-linux64-debug:
runs-on: ubuntu-22.04
container:
image: ubuntu:22.04
env:
DEBIAN_FRONTEND: noninteractive
DEBCONF_NONINTERACTIVE_SEEN: true
steps:
- name: Update git before checkout - https://github.com/actions/checkout/issues/335
run: |
apt update
apt install -y git
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Add safe directory - https://github.com/actions/checkout/issues/1169
run: git config --system --add safe.directory /__w/warfork-qfusion/warfork-qfusion
- name: Install build dependencies
run: |
apt update
apt install -y curl clang cmake build-essential libsdl2-dev libopenal-dev libvorbis-dev libfreetype6-dev libcurl4-gnutls-dev git zip unzip python3
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
unzip third-party/steamworks/sdk.zip -d third-party/steamworks
- name: Setup glslang
working-directory: ./source/glslang
run: |
python3 ./update_glslang_sources.py
- name: Generate makefiles
working-directory: ./source
run: |
export CC=clang CXX=clang++
cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 .
- name: Build project
working-directory: ./source
run: make -j8
- name: Package warfork
working-directory: ./source/build
run: tar -czvf ../Linux-x86_64-Debug.tar.gz * --exclude *.a --exclude base*/*.a libs/*.a
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: linux-x86_64-debug
path: source/Linux-x86_64-Debug.tar.gz
build-osx:
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Install build dependencies
run: |
brew uninstall --force azure-cli
brew uninstall --force aws-sam-cli
brew install python@3 || brew link --overwrite python@3
brew update
brew install curl cmake sdl2 openal-soft libvorbis freetype git zip unzip
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
unzip third-party/steamworks/sdk.zip -d third-party/steamworks
- name: Generate makefiles
working-directory: ./source
run: cmake -DBUILD_STEAMLIB=1 -G Xcode .
- name: Build project
working-directory: ./source
run: xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
- name: Package warfork
working-directory: ./source/build
run: tar -czvf ../OSX-x86_64-Release.tar.gz Release/*.app
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: osx-x86_64-release
path: source/OSX-x86_64-Release.tar.gz
build-osx-debug:
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.4.1'
- name: Install build dependencies
run: |
brew uninstall --force azure-cli
brew uninstall --force aws-sam-cli
brew install python@3 || brew link --overwrite python@3
brew update
brew install curl cmake sdl2 openal-soft libvorbis freetype git zip unzip
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
unzip third-party/steamworks/sdk.zip -d third-party/steamworks
- name: Generate makefiles
working-directory: ./source
run: cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON -G Xcode .
- name: Build project
working-directory: ./source
run: xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Debug -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
- name: Package warfork
working-directory: ./source/build
run: tar -czvf ../OSX-x86_64-Debug.tar.gz Debug/*.app
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: osx-x86_64-debug
path: source/OSX-x86_64-Debug.tar.gz
build-win64:
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
7z x third-party/steamworks/sdk.zip -othird-party/steamworks
- name: Setup glslang
working-directory: ./source/glslang
run: |
python3 ./update_glslang_sources.py
- name: Generate makefiles
working-directory: .\source
run: cmake -G "Visual Studio 17 2022" -A x64 -T "v142" -DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 .
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Build project
working-directory: .\source
run: msbuild qfusion.sln /p:configuration=Release /maxcpucount:8
- name: Package warfork
working-directory: .\source\build\Release
run: 7z a ..\..\win-x86_64-Release.zip * '-xr!*.exp' '-xr!*.lib'
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: win-x86_64-release
path: source\win-x86_64-Release.zip
build-win64-debug:
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download steamworks sdk
run: |
curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip
7z x third-party/steamworks/sdk.zip -othird-party/steamworks
- name: Setup glslang
working-directory: ./source/glslang
run: |
python3 ./update_glslang_sources.py
- name: Generate makefiles
working-directory: .\source
run: cmake -G "Visual Studio 17 2022" -A x64 -T "v142" -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1 .
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Build project
working-directory: .\source
run: msbuild qfusion.sln /p:configuration=Debug /maxcpucount:8
- name: Package warfork
working-directory: .\source\build\Debug
run: 7z a ..\..\win-x86_64-Debug.zip * '-xr!*.exp' '-xr!*.lib'
- name: Upload warfork artifact
uses: actions/upload-artifact@v3
with:
name: win-x86_64-debug
path: source\win-x86_64-Debug.zip