-
-
Notifications
You must be signed in to change notification settings - Fork 384
338 lines (335 loc) · 12.8 KB
/
make.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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
name: Make
on:
workflow_call:
permissions:
contents: write
jobs:
make:
strategy:
matrix:
config:
- name: Linux x86-64 SDL2 Release
os: ubuntu-20.04
dependencies: libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev gettext
env:
FHEROES2_STRICT_COMPILATION: ON
FHEROES2_WITH_TOOLS: ON
FHEROES2_WITH_IMAGE: ON
package_name: fheroes2_ubuntu_x86-64_SDL2.zip
package_files: >-
LICENSE
changelog.txt
fheroes2
./docs/README.txt
files/data/*.h2d
files/lang/*.mo
./script/demo/download_demo_version.sh
./script/homm2/extract_homm2_resources.sh
script/linux/install_sdl2.sh
tools_package_name: fheroes2_tools_ubuntu_x86-64_SDL2.zip
tools_package_files: >-
LICENSE
./docs/GRAPHICAL_ASSETS.md
./script/agg/extract_agg.sh
./src/dist/tools/82m2wav
./src/dist/tools/bin2txt
./src/dist/tools/extractor
./src/dist/tools/h2dmgr
./src/dist/tools/icn2img
./src/dist/tools/pal2img
./src/dist/tools/til2img
./src/dist/tools/xmi2midi
release_name: Ubuntu x86-64 (Linux) build with SDL2 (latest commit)
release_tag: fheroes2-linux-sdl2_dev
- name: Linux x86-64 SDL2 Debug
os: ubuntu-latest
dependencies: libsdl2-dev libsdl2-mixer-dev libsdl2-image-dev gettext
env:
FHEROES2_STRICT_COMPILATION: ON
FHEROES2_WITH_TOOLS: ON
FHEROES2_WITH_IMAGE: ON
FHEROES2_WITH_DEBUG: ON
FHEROES2_WITH_ASAN: ON
- name: Linux ARM64 SDL2 Release
os: ubuntu-22.04
dependencies: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libsdl2-dev:arm64 libsdl2-mixer-dev:arm64 libsdl2-image-dev:arm64 libpng-dev:arm64 gettext
env:
FHEROES2_STRICT_COMPILATION: ON
FHEROES2_WITH_TOOLS: ON
FHEROES2_WITH_IMAGE: ON
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
AR: aarch64-linux-gnu-ar
package_name: fheroes2_ubuntu_arm64_SDL2.zip
package_files: >-
LICENSE
changelog.txt
fheroes2
./docs/README.txt
files/data/*.h2d
files/lang/*.mo
./script/demo/download_demo_version.sh
./script/homm2/extract_homm2_resources.sh
script/linux/install_sdl2.sh
tools_package_name: fheroes2_tools_ubuntu_arm64_SDL2.zip
tools_package_files: >-
LICENSE
./docs/GRAPHICAL_ASSETS.md
./script/agg/extract_agg.sh
./src/dist/tools/82m2wav
./src/dist/tools/bin2txt
./src/dist/tools/extractor
./src/dist/tools/h2dmgr
./src/dist/tools/icn2img
./src/dist/tools/pal2img
./src/dist/tools/til2img
./src/dist/tools/xmi2midi
release_name: Ubuntu ARM64 (Linux) build with SDL2 (latest commit)
release_tag: fheroes2-linux-arm-sdl2_dev
- name: Linux ARM64 SDL2 Debug
os: ubuntu-22.04
dependencies: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libsdl2-dev:arm64 libsdl2-mixer-dev:arm64 libsdl2-image-dev:arm64 libpng-dev:arm64 gettext
env:
FHEROES2_STRICT_COMPILATION: ON
FHEROES2_WITH_TOOLS: ON
FHEROES2_WITH_IMAGE: ON
FHEROES2_WITH_DEBUG: ON
FHEROES2_WITH_TSAN: ON
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
AR: aarch64-linux-gnu-ar
- name: macOS SDL2
os: macos-13
dependencies: sdl2 sdl2_mixer sdl2_image
env:
FHEROES2_STRICT_COMPILATION: ON
FHEROES2_WITH_TOOLS: ON
FHEROES2_WITH_IMAGE: ON
package_name: fheroes2_macos_x86-64_SDL2.zip
package_files: >-
LICENSE
changelog.txt
fheroes2
./docs/README.txt
files/data/*.h2d
files/lang/*.mo
./script/demo/download_demo_version.sh
./script/homm2/extract_homm2_resources.sh
script/macos/install_sdl2.sh
tools_package_name: fheroes2_tools_macos_x86-64_SDL2.zip
tools_package_files: >-
LICENSE
./docs/GRAPHICAL_ASSETS.md
./script/agg/extract_agg.sh
./src/dist/tools/82m2wav
./src/dist/tools/bin2txt
./src/dist/tools/extractor
./src/dist/tools/h2dmgr
./src/dist/tools/icn2img
./src/dist/tools/pal2img
./src/dist/tools/til2img
./src/dist/tools/xmi2midi
release_name: macOS x86-64 build with SDL2 (latest commit)
release_tag: fheroes2-osx-sdl2_dev
- name: macOS SDL2 App Bundle
os: macos-latest
dependencies: sdl2 sdl2_mixer dylibbundler
env:
FHEROES2_STRICT_COMPILATION: ON
FHEROES2_WITH_TOOLS: ON
FHEROES2_MACOS_APP_BUNDLE: ON
name: Make (${{ matrix.config.name }})
runs-on: ${{ matrix.config.os }}
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: ${{ startsWith( matrix.config.os, 'ubuntu-' ) }}
run: |
if [[ "${{ matrix.config.name }}" == *ARM64* ]]
then
sudo sed -i -e 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo sh -c '. /etc/os-release;
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${VERSION_CODENAME} main restricted universe multiverse" > /etc/apt/sources.list.d/arm64.list;
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${VERSION_CODENAME}-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/arm64.list;
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${VERSION_CODENAME}-security main restricted universe multiverse" >> /etc/apt/sources.list.d/arm64.list;
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports ${VERSION_CODENAME}-backports main restricted universe multiverse" >> /etc/apt/sources.list.d/arm64.list;'
fi
sudo apt-get -y update
sudo apt-get -y install ${{ matrix.config.dependencies }}
- name: Install dependencies (macOS)
if: ${{ startsWith( matrix.config.os, 'macos-' ) }}
run: |
brew install ${{ matrix.config.dependencies }}
env:
# Do not update outdated dependencies of installed packages
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: ON
- name: Build
run: |
make -j 2
env: ${{ matrix.config.env }}
- name: Create package
if: ${{ matrix.config.package_name != '' && matrix.config.package_files != '' }}
run: |
7z a -bb1 -tzip -- ${{ matrix.config.package_name }} ${{ matrix.config.package_files }}
- name: Create tools package
if: ${{ matrix.config.tools_package_name != '' && matrix.config.tools_package_files != '' }}
run: |
7z a -bb1 -tzip -- ${{ matrix.config.tools_package_name }} ${{ matrix.config.tools_package_files }}
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' && matrix.config.package_name != '' }}
with:
name: ${{ matrix.config.package_name }}
path: ${{ matrix.config.package_name }}
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' && matrix.config.tools_package_name != '' }}
with:
name: ${{ matrix.config.tools_package_name }}
path: ${{ matrix.config.tools_package_name }}
if-no-files-found: error
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' && matrix.config.package_name != '' && matrix.config.tools_package_name == '' && matrix.config.release_name != '' && matrix.config.release_tag != '' }}
with:
artifacts: ${{ matrix.config.package_name }}
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ matrix.config.release_name }}
tag: ${{ matrix.config.release_tag }}
allowUpdates: true
artifactErrorsFailBuild: true
prerelease: true
replacesArtifacts: true
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' && matrix.config.package_name != '' && matrix.config.tools_package_name != '' && matrix.config.release_name != '' && matrix.config.release_tag != '' }}
with:
artifacts: ${{ matrix.config.package_name }}, ${{ matrix.config.tools_package_name }}
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ matrix.config.release_name }}
tag: ${{ matrix.config.release_tag }}
allowUpdates: true
artifactErrorsFailBuild: true
prerelease: true
replacesArtifacts: true
make-psv:
name: Make (PS Vita)
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install libgcc1 gettext
- name: Prepare Vita SDK cache
uses: actions/cache@v4
with:
path: ~/.vitasdk-cache
key: make-vitasdk-cache-${{ github.sha }}
restore-keys: |
make-vitasdk-cache-
- name: Setup Vita SDK
continue-on-error: true
run: |
git clone --depth 1 https://github.com/vitasdk/vdpm
cd vdpm
export PATH="$VITASDK/bin:$PATH"
./bootstrap-vitasdk.sh
./install-all.sh
rm -rf ~/.vitasdk-cache
env:
VITASDK: /usr/local/vitasdk
- name: Restore Vita SDK from cache
run: |
if [[ -d ~/.vitasdk-cache ]]; then
sudo rm -rf /usr/local/vitasdk
sudo mv ~/.vitasdk-cache /usr/local/vitasdk
fi
- name: Build
run: |
export PATH="$VITASDK/bin:$PATH"
make -f Makefile.vita -j 2
env:
FHEROES2_STRICT_COMPILATION: ON
VITASDK: /usr/local/vitasdk
- name: Update Vita SDK cache
run: |
if [[ -d /usr/local/vitasdk ]]; then
rm -rf ~/.vitasdk-cache
sudo mv /usr/local/vitasdk ~/.vitasdk-cache
fi
- name: Create package
run: |
# Translations and H2D files are already included in fheroes2.vpk
7z a -bb1 -tzip -- fheroes2_psv.zip LICENSE changelog.txt fheroes2.vpk ./docs/README.txt ./docs/README_PSV.md
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: fheroes2_psv.zip
path: fheroes2_psv.zip
if-no-files-found: error
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' }}
with:
artifacts: fheroes2_psv.zip
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: PS Vita build (latest commit)
tag: fheroes2-psv-sdl2_dev
allowUpdates: true
artifactErrorsFailBuild: true
prerelease: true
replacesArtifacts: true
make-switch:
name: Make (Nintendo Switch)
runs-on: ubuntu-latest
container: devkitpro/devkita64:latest
timeout-minutes: 30
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install gettext p7zip-full
- name: Build
run: |
export PATH="$DEVKITPRO/tools/bin:$DEVKITPRO/portlibs/switch/bin:$DEVKITPRO/devkitA64/bin:$PATH"
make -f Makefile.switch -j 2
env:
FHEROES2_STRICT_COMPILATION: ON
DEVKITPRO: /opt/devkitpro
- name: Generate translations
run: |
make -C files/lang -j 2
- name: Create package
run: |
7z a -bb1 -tzip -- fheroes2_switch.zip LICENSE changelog.txt fheroes2.nro ./docs/README.txt ./docs/README_switch.md files/data/*.h2d files/lang/*.mo
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: fheroes2_switch.zip
path: fheroes2_switch.zip
if-no-files-found: error
- uses: ncipollo/release-action@v1
if: ${{ github.event_name == 'push' }}
with:
artifacts: fheroes2_switch.zip
body: ${{ github.event.head_commit.message }}
token: ${{ secrets.GITHUB_TOKEN }}
name: Nintendo Switch build (latest commit)
tag: fheroes2-switch-sdl2_dev
allowUpdates: true
artifactErrorsFailBuild: true
prerelease: true
replacesArtifacts: true