Repository navigation
149 lines (144 loc) · 4.44 KB
/
Copy pathbuild.yml
File metadata and controls
149 lines (144 loc) · 4.44 KB
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
name: Build
# Only build when something that affects the binaries changes;
# documentation and script edits do not start a run.
on:
push:
branches: [master, dev]
paths:
- "src/**"
- "Makefile"
- ".github/workflows/build.yml"
pull_request:
paths:
- "src/**"
- "Makefile"
- ".github/workflows/build.yml"
workflow_dispatch:
jobs:
linux:
name: Linux (${{ matrix.bits }}-bit), CoD2 ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- version: "1.0"
protocol: 115
arch: x64
bits: 64
artifact: cod2rev_lnxded-1.0
- version: "1.3"
protocol: 118
arch: x64
bits: 64
artifact: cod2rev_lnxded-1.3
- version: "1.0"
protocol: 115
arch: x86
bits: 32
artifact: cod2rev_lnxded-1.0-x86
- version: "1.3"
protocol: 118
arch: x86
bits: 32
artifact: cod2rev_lnxded-1.3-x86
- version: "1.3 Plus"
protocol: 118
arch: x64
bits: 64
plus: 1
artifact: cod2rev_lnxded-1.3-plus
steps:
- uses: actions/checkout@v7
- name: Install 32-bit toolchain
if: matrix.arch == 'x86'
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib
- name: Build
run: |
make -j"$(nproc)" PROTOCOL=${{ matrix.protocol }} ARCH=${{ matrix.arch }} PLUS=${{ matrix.plus || 0 }}
- name: Start the server without game files
# Exit code 1 with the engine's own error message; a crash at startup
# or a hang would end differently
run: |
mkdir ci-empty
cd ci-empty
code=0
timeout 30 ../bin/cod2rev_lnxded +set fs_basepath . +set dedicated 1 2>err.log >/dev/null || code=$?
cat err.log
test "$code" = 1
grep -q Sys_Error err.log
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}
path: bin/cod2rev_lnxded
if-no-files-found: error
mysql:
# Only checks that the MySQL functions build; the binary needs the
# client library at run time, so it is not published.
name: Linux (64-bit) with MySQL, CoD2 1.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install the MariaDB client library
run: |
sudo apt-get update
sudo apt-get install -y libmariadb-dev
- name: Build
run: |
make -j"$(nproc)" WITH_MYSQL=true
windows:
name: Windows (MinGW cross-build), CoD2 ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- version: "1.0"
protocol: 115
- version: "1.3"
protocol: 118
steps:
- uses: actions/checkout@v7
- name: Install MinGW-w64
run: |
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-i686-posix g++-mingw-w64-i686-posix binutils-mingw-w64-i686
- name: Build
run: |
make -j"$(nproc)" PROTOCOL=${{ matrix.protocol }} windows
- uses: actions/upload-artifact@v7
with:
name: cod2rev_win32-${{ matrix.version }}
path: |
bin/cod2rev_win32.exe
scripts/windows/iniciar_cod2rev.bat
if-no-files-found: error
windows-native:
# Builds on Windows itself, from cmd, as an admin without Linux would:
# the Makefile's Windows_NT branch (md, del) only runs here.
name: Windows (native MinGW), CoD2 ${{ matrix.version }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- version: "1.0"
protocol: 115
- version: "1.3"
protocol: 118
steps:
- uses: actions/checkout@v7
- id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: false
install: mingw-w64-i686-gcc mingw-w64-i686-make
- name: Build from cmd
shell: cmd
run: |
set "PATH=${{ steps.msys2.outputs.msys2-location }}\mingw32\bin;%SystemRoot%\system32;%SystemRoot%"
mingw32-make -j%NUMBER_OF_PROCESSORS% PROTOCOL=${{ matrix.protocol }}
if not exist bin\cod2rev_win32.exe exit /b 1