forked from id-Software/Enemy-Territory
-
Notifications
You must be signed in to change notification settings - Fork 18
323 lines (284 loc) · 12.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
name: build
on:
# Run on pushes to tags, the "master" branch, and PR's
push:
tags-ignore:
branches:
- master
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
pull_request:
paths-ignore:
- '**.md'
- '*.txt'
- '.gitignore'
- 'docs/*'
workflow_dispatch:
jobs:
windows-msvc:
name: ${{ matrix.config }} Windows ${{ matrix.arch }}
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
#arch: [arm64, x86, x64]
#arch: [x86, x64]
arch: [x86, x64]
config: [Release]
include:
# - arch: arm64
# platform: ARM64
# suffix: .arm64
# pkg_suffix: arm64
- arch: x86
platform: Win32
pkg_suffix: x86
- arch: x64
platform: x64
suffix: .x64
pkg_suffix: x64
steps:
- uses: microsoft/[email protected]
#- name: Install v141_xp Toolset
# shell: powershell
# run: |
# Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
# $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
# $WorkLoads = '--add Microsoft.VisualStudio.Component.WinXP'
# $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
# $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
# if ($process.ExitCode -eq 0) {
# Write-Host "components have been successfully added"
# } else {
# Write-Host "components were not installed"
# }
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build Engine
working-directory: ${{github.workspace}}/src
run: |
msbuild win32\msvc2017\wolfded.vcxproj -m -p:TargetName=ETe.ded,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild win32\msvc2017\renderer.vcxproj -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild win32\msvc2017\wolf.vcxproj -m -p:TargetName=ETe,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }},UseWasapi=USE_WASAPI=0
#msbuild win32\msvc2017\steam.vcxproj -m -p:TargetName=ete-steamlaunch,Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
- name: Build etmain
working-directory: ${{github.workspace}}/src
run: |
msbuild win32\msvc2017\game.vcxproj -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild win32\msvc2017\ui.vcxproj -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
msbuild win32\msvc2017\cgame.vcxproj -m -p:Configuration=${{ matrix.config }},Platform=${{ matrix.platform }}
- name: Create Binary Directory
working-directory: ${{github.workspace}}
run: mkdir bin
- name: Copy outputs to Binary Directory
working-directory: ${{github.workspace}}/src
run: |
copy win32\msvc2017\output\${{ matrix.config }}\ETe.ded.exe ${{github.workspace}}\bin\ETe.ded${{ matrix.suffix }}.exe
copy win32\msvc2017\output\${{ matrix.config }}\ETe.exe ${{github.workspace}}\bin\ETe${{ matrix.suffix }}.exe
copy win32\msvc2017\output\${{ matrix.config }}\qagame_mp_${{ matrix.pkg_suffix }}.dll ${{github.workspace}}\bin\
copy win32\msvc2017\output\${{ matrix.config }}\ui_mp_${{ matrix.pkg_suffix }}.dll ${{github.workspace}}\bin\
copy win32\msvc2017\output\${{ matrix.config }}\cgame_mp_${{ matrix.pkg_suffix }}.dll ${{github.workspace}}\bin\
#copy win32\msvc2017\output\${{ matrix.config }}\ete-steamlaunch.exe ${{github.workspace}}\bin\ete-steamlaunch${{ matrix.suffix }}.exe
- uses: actions/upload-artifact@v3
if: ${{ matrix.config == 'Release' }}
with:
name: windows-${{ matrix.pkg_suffix }}
path: |
bin/*.exe
bin/*.dll
if-no-files-found: error
retention-days: 5
ubuntu-x86:
name: ${{ matrix.config }} Ubuntu ${{ matrix.arch }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
arch: [x86, x86_64]
cc: [gcc]
cxx: [g++]
config: [Release]
include:
- config: Release
rule: install
- arch: x86
use_sdl: true
- arch: x86_64
use_sdl: true
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 g++-multilib ninja-build
sudo apt-get -y install libjpeg-dev:i386 libsdl2-dev:i386 libcurl4-openssl-dev:i386
else
sudo apt-get -qq update
sudo apt-get -y install ninja-build libjpeg-dev libsdl2-dev libcurl4-openssl-dev
fi
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create Build Directory
working-directory: ${{github.workspace}}/src
run: cmake -E make_directory ${{github.workspace}}/src/bin
- name: Configure CMake (Engine)
working-directory: ${{github.workspace}}/src/bin
run: |
if [ ${{ matrix.arch }} == "x86" ]; then
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DUSE_SDL2=${{ matrix.use_sdl }} -DBUILD_ETMAIN_MOD=OFF -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/linux-i686.cmake
else
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DUSE_SDL2=${{ matrix.use_sdl }} -DBUILD_ETMAIN_MOD=OFF
fi
- name: Build (Engine)
working-directory: ${{github.workspace}}/src/bin
run: cmake --build . --config ${{ matrix.config }} --parallel
- name: Configure CMake (etmain)
working-directory: ${{github.workspace}}/src/bin
run: |
rm CMakeCache.txt
if [ ${{ matrix.arch }} == "x86" ]; then
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBUILD_DEDSERVER=OFF -DBUILD_CLIENT=OFF -DBUILD_ETMAIN_MOD=ON -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/linux-i686.cmake
else
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBUILD_DEDSERVER=OFF -DBUILD_CLIENT=OFF -DBUILD_ETMAIN_MOD=ON
fi
- name: Build (etmain)
working-directory: ${{github.workspace}}/src/bin
run: cmake --build . --config ${{ matrix.config }} --parallel
- uses: actions/upload-artifact@v3
if: matrix.cc == 'gcc' && matrix.config == 'Release'
with:
name: linux-${{ matrix.arch }}
path: |
src/bin/ete*.${{ matrix.arch }}
src/bin/*.so
if-no-files-found: error
retention-days: 5
macos-x86:
name: ${{ matrix.config }} macOS ${{ matrix.arch }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64]
cc: [clang]
cxx: [clang++]
config: [Debug]
include:
- config: Debug
rule: install
steps:
- name: Install tools
run: brew install coreutils ninja pkg-config sdl2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Create Build Directory
working-directory: ${{github.workspace}}/src
run: cmake -E make_directory ${{github.workspace}}/src/bin
- name: Configure CMake (Engine)
working-directory: ${{github.workspace}}/src/bin
run: cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DUSE_SDL2=TRUE -DBUILD_ETMAIN_MOD=OFF -DUSE_SYSTEM_JPEG=OFF
- name: Build (Engine)
working-directory: ${{github.workspace}}/src/bin
run: cmake --build . --config ${{ matrix.config }} --parallel
- name: Configure CMake (etmain)
working-directory: ${{github.workspace}}/src/bin
run: |
rm CMakeCache.txt
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DBUILD_DEDSERVER=FALSE -DBUILD_CLIENT=FALSE -DBUILD_ETMAIN_MOD=TRUE
- name: Build (etmain)
working-directory: ${{github.workspace}}/src/bin
run: cmake --build . --config ${{ matrix.config }} --parallel
- uses: actions/upload-artifact@v3
if: matrix.cc == 'clang' #&& matrix.config == 'Release'
with:
name: macos-${{ matrix.arch }}
path: |
src/bin/ete*.${{ matrix.arch }}
src/bin/*_mac
if-no-files-found: error
retention-days: 5
create-testing:
if: github.ref == 'refs/heads/master' && github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [windows-msvc, ubuntu-x86, macos-x86]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Create binary archives
run: |
7z a -r ete-linux-x86.zip ./linux-x86/* -x!*.so
7z a -r ete-linux-x86_64.zip ./linux-x86_64/* -x!*.so
7z a -r ete-windows-msvc-x86.zip ./windows-x86/* -x!*.dll
7z a -r ete-windows-msvc-x64.zip ./windows-x64/* -x!*.dll
7z a -r ete-macos-x86_64.zip ./macos-x86_64/* -x!*_mac
7z a -r ete-linux-x86.zip ./steam/steam_appid.txt
7z a -r ete-linux-x86_64.zip ./steam/steam_appid.txt
7z a -r ete-windows-msvc-x86.zip ./steam/steam_appid.txt
7z a -r ete-windows-msvc-x64.zip ./steam/steam_appid.txt
7z a -r ete-macos-x86_64.zip ./steam/steam_appid.txt
mkdir -p etmain
mv -t ./etmain/ ./linux-x86/*.so
mv -t ./etmain/ ./linux-x86_64/*.so
mv -t ./etmain/ ./windows-x86/*.dll
mv -t ./etmain/ ./windows-x64/*.dll
mv -t ./etmain/ ./macos-x86_64/*_mac
cd etmain
7z a -r -tzip mp_bina.pk3 ./cgame*.so
7z a -r -tzip mp_bina.pk3 ./ui*.so
7z a -r -tzip mp_bina.pk3 ./cgame*.dll
7z a -r -tzip mp_bina.pk3 ./ui*.dll
7z a -r -tzip mp_bina.pk3 ./cgame_mac
7z a -r -tzip mp_bina.pk3 ./ui_mac
cd ..
7z a -r ete-etmain-mod-replacement-allplatform.zip ./etmain/*.pk3
7z a -r ete-etmain-mod-replacement-allplatform.zip ./etmain/*.so
7z a -r ete-etmain-mod-replacement-allplatform.zip ./etmain/*.dll
7z a -r ete-etmain-mod-replacement-allplatform.zip ./etmain/*_mac
- name: Create Client Hashes
run: |
md5sum ./linux-x86/ete.x86 > ete.x86.md5
sha1sum ./linux-x86/ete.x86 > ete.x86.sha1
7z a -r ete-client-hashes.zip ete.x86.md5 ete.x86.sha1
md5sum ./linux-x86_64/ete.x86_64 > ete.x86_64.md5
sha1sum ./linux-x86_64/ete.x86_64 > ete.x86_64.sha1
7z a -r ete-client-hashes.zip ete.x86_64.md5 ete.x86_64.sha1
md5sum ./windows-x86/ETe.exe > ETe.exe.md5
sha1sum ./windows-x86/ETe.exe > ETe.exe.sha1
7z a -r ete-client-hashes.zip ETe.exe.md5 ETe.exe.sha1
md5sum ./windows-x64/ETe.x64.exe > ETe.x64.exe.md5
sha1sum ./windows-x64/ETe.x64.exe > ETe.x64.exe.sha1
7z a -r ete-client-hashes.zip ETe.x64.exe.md5 ETe.x64.exe.sha1
md5sum ./macos-x86_64/ete.x86_64 > ete_mac.x86_64.md5
sha1sum ./macos-x86_64/ete.x86_64 > ete_mac.x86_64.sha1
7z a -r ete-client-hashes.zip ete_mac.x86_64.md5 ete_mac.x86_64.sha1
#TODO other builds
#NOTE purposely skipping etmain for macos as it is not really functional
#7z a -r ete-windows-mingw-x86.zip ./windows-mingw-x86/* -x!*.dll
#7z a -r ete-windows-mingw-x86_64.zip ./windows-mingw-x86_64/* -x!*.dll
#7z a -r ete-windows-msvc-arm64.zip ./windows-arm64/* -x!*.dll
#7z a -r ete-macos-arm64.zip ./macos-arm64/* -x!*.dylib
#7z a -r ete-linux-aarch64.zip ./linux-aarch64/*
#7z a -r ete-linux-armv7.zip ./linux-armv7/*
#7z a -r -tzip mp_bina.pk3 ./*.dylib
- name: Create docs archive
run: |
7z a -r ete-docs.zip ./docs/*
- name: Create latest build
uses: marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelease: false
title: Latest Build
files: |
*.zip