-
Notifications
You must be signed in to change notification settings - Fork 4
296 lines (251 loc) · 11 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
name: Build Workflow
on:
workflow_dispatch:
inputs:
build_type:
description: 'Build Configuration to use (Debug, Release, RelWithDebInfo or MinSizeRel).'
required: false
default: 'Debug'
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**/doc'
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- '**.md'
- '**.yml'
- '**/doc'
jobs:
Linux-x64:
name: Linux x64
runs-on: ubuntu-latest
container: ubuntu:22.04
steps:
- name: Set build configuration
id: build_configuration
run: |
BUILD_TYPE=${{github.event.inputs.build_type}}
echo "build_type=${BUILD_TYPE:-"Debug"}" >> $GITHUB_OUTPUT
- name: Setup Dependencies
run: |
apt update -y && apt install -y sudo
sudo apt-get update -y
sudo apt-get install -y ca-certificates gpg wget
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update -y
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
sudo apt-get install kitware-archive-keyring
sudo apt install -y file build-essential cmake ninja-build wget gettext p7zip-full libsdl2-dev
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-linux-x86_64.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
- name: Test
run: |
cd ${{steps.build_configuration.outputs.build_type}}
ctest
- name: Package Source
run: |
cd ${{steps.build_configuration.outputs.build_type}}
cpack --config CPackSourceConfig.cmake
mkdir -p Artifacts/Linux-x64
cp *.tar.gz Artifacts/Linux-x64/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts
Linux-x86:
name: Linux x86
runs-on: ubuntu-latest
container: ubuntu:22.04
steps:
- name: Set build configuration
id: build_configuration
run: |
BUILD_TYPE=${{github.event.inputs.build_type}}
echo "build_type=${BUILD_TYPE:-"Debug"}" >> $GITHUB_OUTPUT
- name: Setup Dependencies
run: |
apt update -y && apt install -y sudo
sudo dpkg --add-architecture i386
sudo apt-get update -y
sudo apt-get install -y ca-certificates gpg wget
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update -y
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
sudo apt-get install kitware-archive-keyring
sudo apt-get install -y file build-essential cmake debmake dh-make gcc-multilib g++-multilib ninja-build:i386 wget gettext p7zip-full libsdl2-dev:i386
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-linux-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
- name: Test
run: |
cd ${{steps.build_configuration.outputs.build_type}}
ctest
- name: Package Source
run: |
cd ${{steps.build_configuration.outputs.build_type}}
cpack --config CPackSourceConfig.cmake
mkdir -p Artifacts/Linux-x86
cp *.tar.gz Artifacts/Linux-x86/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts
WindowsXP-x86:
name: Windows XP x86
runs-on: ubuntu-latest
container: ubuntu:23.10
steps:
- name: Set build configuration
id: build_configuration
run: |
BUILD_TYPE=${{github.event.inputs.build_type}}
echo "build_type=${BUILD_TYPE:-"Debug"}" >> $GITHUB_OUTPUT
- name: Setup Dependencies
run: |
apt update -y && apt install -y sudo
sudo dpkg --add-architecture i386
sudo apt-get update -y
sudo apt-get install -y file build-essential binutils-mingw-w64-i686 g++-mingw-w64-i686 gcc-mingw-w64-i686 ninja-build:i386 cmake nsis gettext p7zip-full
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-cross-mingw-w64-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
- name: Package
run: |
cd ${{steps.build_configuration.outputs.build_type}}
cpack --config CPackConfig.cmake
cpack --config CPackSourceConfig.cmake
mkdir -p Artifacts/WindowsXP-x86
cp *-win32.7z Artifacts/WindowsXP-x86/
cp *-Source.7z Artifacts/WindowsXP-x86/
7z a -mx9 -bd max-port-win32-symbols.7z max.debug
cp max-port-win32-symbols.7z Artifacts/WindowsXP-x86/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts
Windows-x64:
name: Windows x64
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
- name: Set build configuration
id: build_configuration
run: |
BUILD_TYPE=${{github.event.inputs.build_type}}
echo "build_type=${BUILD_TYPE:-"Debug"}" >> $GITHUB_OUTPUT
- name: Setup Dependencies
run: |
pacman -S --noconfirm git mingw-w64-x86_64-toolchain p7zip mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-nsis mingw-w64-x86_64-gettext make
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw-w64-x86_64.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
- name: Test
run: |
cd ${{steps.build_configuration.outputs.build_type}}
ctest
- name: Package
run: |
cd ${{steps.build_configuration.outputs.build_type}}
cpack --config CPackConfig.cmake
cpack --config CPackSourceConfig.cmake
mkdir -p Artifacts/Windows-x64
cp *-win64.exe Artifacts/Windows-x64/
cp *-win64.7z Artifacts/Windows-x64/
cp *-Source.7z Artifacts/Windows-x64/
7z a -mx9 -bd max-port-win64-symbols.7z max.debug
cp max-port-win64-symbols.7z Artifacts/Windows-x64/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts
Windows-x86:
name: Windows x86
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
- name: Set build configuration
id: build_configuration
run: |
BUILD_TYPE=${{github.event.inputs.build_type}}
echo "build_type=${BUILD_TYPE:-"Debug"}" >> $GITHUB_OUTPUT
- name: Setup Dependencies
run: |
pacman -S --noconfirm git mingw-w64-i686-toolchain p7zip mingw-w64-i686-cmake mingw-w64-i686-ninja mingw-w64-i686-nsis mingw-w64-i686-gettext make
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw-w64-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
- name: Test
run: |
cd ${{steps.build_configuration.outputs.build_type}}
ctest
- name: Package
run: |
cd ${{steps.build_configuration.outputs.build_type}}
cpack --config CPackConfig.cmake
cpack --config CPackSourceConfig.cmake
mkdir -p Artifacts/Windows-x86
cp *-win32.exe Artifacts/Windows-x86/
cp *-win32.7z Artifacts/Windows-x86/
cp *-Source.7z Artifacts/Windows-x86/
7z a -mx9 -bd max-port-win32-symbols.7z max.debug
cp max-port-win32-symbols.7z Artifacts/Windows-x86/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts