-
Notifications
You must be signed in to change notification settings - Fork 6
323 lines (277 loc) · 10.2 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
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: build
on:
pull_request:
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
push:
branches:
- master
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
release:
types: [published]
workflow_dispatch:
jobs:
# windows_msys:
# name: ${{ matrix.config }} Windows ${{ matrix.arch }}
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# arch: [x86, x86_64]
# cc: [gcc]
# config: [Release]
# include:
# - arch: x86
# msystem: MINGW32
# prefix: mingw-w64-i686
# - arch: x86_64
# msystem: MINGW64
# prefix: mingw-w64-x86_64
# - config: Release
# rule: install
#
# defaults:
# run:
# shell: msys2 {0}
#
# steps:
# - uses: msys2/setup-msys2@v2
# with:
# install: ${{ matrix.prefix }}-binutils ${{ matrix.prefix }}-make ${{ matrix.prefix }}-${{ matrix.cc }}
# msystem: ${{ matrix.msystem }}
# path-type: minimal
# release: false
# update: false
#
# - uses: actions/checkout@v2
# with:
# submodules: recursive
#
# - name: Build
# run: |
# make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 USE_SDL=0 USE_VULKAN=1 CNAME=quake3e-vulkan BUILD_SERVER=0
# make clean ARCH=${{ matrix.arch }}
# make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 USE_SDL=0 USE_VULKAN_API=0
#
# - uses: actions/upload-artifact@v2
# if: matrix.cc == 'gcc' && matrix.config == 'Release'
# with:
# name: windows-${{ matrix.arch }}
# path: bin
# if-no-files-found: error
# retention-days: 5
windows-msvc:
name: ${{ matrix.config }} Windows ${{ matrix.arch }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [arm64, x86, x64]
config: [Release]
include:
- arch: arm64
platform: ARM64
suffix: .arm64
- arch: x86
platform: Win32
- arch: x64
platform: x64
suffix: .x64
steps:
- uses: microsoft/[email protected]
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
run: |
mkdir bin
msbuild code\win32\msvc2017\quake3e-ded.vcxproj -m -p:TargetName=quake3e.ded,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
copy code\win32\msvc2017\output\quake3e.ded.exe bin\quake3e.ded${{ matrix.suffix }}.exe
msbuild code\win32\msvc2017\renderer.vcxproj -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild code\win32\msvc2017\quake3e.vcxproj -m -p:TargetName=quake3e,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }},UseWasapi=USE_WASAPI=0
copy code\win32\msvc2017\output\quake3e.exe bin\quake3e${{ matrix.suffix }}.exe
msbuild code\win32\msvc2017\renderer.vcxproj -t:Clean -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild code\win32\msvc2017\quake3e.vcxproj -t:Clean -m -p:TargetName=quake3e,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild code\win32\msvc2017\renderervk.vcxproj -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild code\win32\msvc2017\quake3e.vcxproj -m -p:TargetName=quake3e,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }},UseWasapi=USE_WASAPI=0
copy code\win32\msvc2017\output\quake3e.exe bin\quake3e-vulkan${{ matrix.suffix }}.exe
- uses: actions/upload-artifact@v2
if: ${{ matrix.config == 'Release' }}
with:
name: windows-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
ubuntu-x86:
name: ${{ matrix.config }} Ubuntu ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
config: [Release]
include:
- config: Release
rule: install
steps:
- name: Install tools
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install gcc-multilib libcurl4-openssl-dev:i386 mesa-common-dev:i386 libxxf86dga-dev:i386 libxrandr-dev:i386 libxxf86vm-dev:i386 libasound-dev:i386
else
sudo apt-get -qq update
sudo apt-get -y install libcurl4-openssl-dev mesa-common-dev libxxf86dga-dev libxrandr-dev libxxf86vm-dev libasound-dev
fi
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
run: |
make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 USE_SDL=0 USE_VULKAN=1 CNAME=quake3e-vulkan BUILD_SERVER=0
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j 8 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 USE_SDL=0 USE_VULKAN_API=0
- uses: actions/upload-artifact@v2
if: matrix.cc == 'gcc' && matrix.config == 'Release'
with:
name: linux-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
ubuntu-arm:
name: ${{ matrix.config }} Ubuntu ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [aarch64, armv7]
cc: [gcc]
config: [Release]
include:
- config: Release
rule: install
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build ${{ matrix.arch }}
uses: uraimo/[email protected]
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
shell: /bin/sh
run: |
apt-get -qq update
apt-get install -y make gcc g++
apt-get -y install libcurl4-openssl-dev mesa-common-dev libxxf86dga-dev libxrandr-dev libxxf86vm-dev libasound-dev
make ${{ matrix.rule }} -j 4 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 USE_SDL=0 USE_VULKAN=1 CNAME=quake3e-vulkan BUILD_SERVER=0
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j 4 ARCH=${{ matrix.arch }} CC=${{ matrix.cc }} DESTDIR=bin USE_RENDERER_DLOPEN=0 USE_SDL=0 USE_VULKAN_API=0
- uses: actions/upload-artifact@v2
if: matrix.cc == 'gcc' && matrix.config == 'Release'
with:
name: linux-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
macos-x86:
name: ${{ matrix.config }} macOS x86_64
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64]
cc: [clang]
config: [Release]
include:
- config: Release
rule: install
steps:
- name: Install tools
run: brew install coreutils sdl2
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build
run: |
make ${{ matrix.rule }} -j 4 CC=${{ matrix.cc }} DESTDIR=bin INSTALL=ginstall USE_RENDERER_DLOPEN=0 USE_VULKAN=1 CNAME=quake3e-vulkan BUILD_SERVER=0
make clean ARCH=${{ matrix.arch }}
make ${{ matrix.rule }} -j 4 CC=${{ matrix.cc }} DESTDIR=bin INSTALL=ginstall USE_RENDERER_DLOPEN=0 USE_VULKAN_API=0
- uses: actions/upload-artifact@v2
if: matrix.cc == 'clang' && matrix.config == 'Release'
with:
name: macos-${{ matrix.arch }}
path: bin
if-no-files-found: error
retention-days: 5
create-testing:
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
needs: [windows-msvc, ubuntu-x86, ubuntu-arm, macos-x86]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Create binary archives
run: |
7z a -r quake3e-linux-aarch64.zip ./linux-aarch64/*
7z a -r quake3e-linux-armv7.zip ./linux-armv7/*
7z a -r quake3e-linux-x86.zip ./linux-x86/*
7z a -r quake3e-linux-x86_64.zip ./linux-x86_64/*
7z a -r quake3e-windows-arm64.zip ./windows-arm64/*
7z a -r quake3e-windows-x86.zip ./windows-x86/*
7z a -r quake3e-windows-x64.zip ./windows-x64/*
7z a -r quake3e-macos-x86_64.zip ./macos-x86_64/*
- name: Create latest build
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelease: false
title: Latest Build
files: |
*.zip
update-release:
if: ${{ github.event_name == 'release' }}
needs: [windows-msvc, ubuntu-x86, ubuntu-arm, macos-x86]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- artifact_dir: linux-aarch64
artifact_name: quake3e-linux-aarch64.zip
- artifact_dir: linux-armv7
artifact_name: quake3e-linux-armv7.zip
- artifact_dir: linux-x86
artifact_name: quake3e-linux-x86.zip
- artifact_dir: linux-x86_64
artifact_name: quake3e-linux-x86_64.zip
- artifact_dir: windows-arm64
artifact_name: quake3e-windows-arm64.zip
- artifact_dir: windows-x86
artifact_name: quake3e-windows-x86.zip
- artifact_dir: windows-x64
artifact_name: quake3e-windows-x64.zip
- artifact_dir: macos-x86_64
artifact_name: quake3e-macos-x86_64.zip
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
- name: Create archive
run: 7z a -r ${{ matrix.artifact_name }} ./${{ matrix.artifact_dir }}/*
- name: Upload archive
uses: "svenstaro/upload-release-action@v2"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
overwrite: true
file: ${{ matrix.artifact_name }}