-
Notifications
You must be signed in to change notification settings - Fork 49
341 lines (295 loc) · 9.69 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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
name: CI
on:
push:
branches: [master, dev, development, feature/**, bugfix/**, pr/**]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
prepare:
name: General preparations
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set outputs
id: vars
run: echo "short_sha=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
- name: Check outputs
run: echo "short_sha = ${{ steps.vars.outputs.short_sha }}"
outputs:
short_sha: ${{ steps.vars.outputs.short_sha }}
dist:
name: Distribution archives
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -yqq
sudo apt-get install -yqq git asciidoctor w3m
- name: Checkout
uses: actions/checkout@v4
- name: Generate Archives
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
builds/ci/adoc2man ${SHORT_SHA} < res/unix/OpenJazz.6.adoc > OpenJazz.6
git archive -o openjazz-${SHORT_SHA}.tar.gz \
--prefix=openjazz-${SHORT_SHA}/res/unix/ --add-file=OpenJazz.6 \
--prefix=openjazz-${SHORT_SHA}/ ${GITHUB_SHA}
git archive -o openjazz-${SHORT_SHA}.zip --prefix=openjazz-${SHORT_SHA}/ ${GITHUB_SHA}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-dist
path: openjazz-*.*
linux-gcc:
name: Build (Ubuntu x86_64, GCC, SDL1.2)
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -yqq
sudo apt-get install -yqq build-essential libsdl1.2-dev
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz (normal)
run: |
export MAKEFLAGS=-j$(nproc)
make
ls -l OpenJazz
linux-clang:
name: Build (Ubuntu 20.04 LTS x86_64, Clang, SDL2)
needs: prepare
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: |
sudo apt-get update -yqq
sudo apt-get install -yqq build-essential cmake ninja-build clang-10 \
libsdl2-dev asciidoctor w3m
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz (slim)
run: |
export CXX=clang++
export CXXFLAGS="-Wall -O2 -g -ffunction-sections -fdata-sections"
export LDFLAGS="-Wl,--gc-sections"
cmake --workflow --preset release
ls -l build-release/OpenJazz
build-release/OpenJazz --version
- name: Prepare artifact
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
mkdir OJ-${SHORT_SHA}
builds/ci/adoc2txt ${SHORT_SHA} < res/unix/OpenJazz.6.adoc > OJ-${SHORT_SHA}/Manual.txt
cp build-release/OpenJazz README.md COPYING licenses.txt OJ-${SHORT_SHA}/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-linux-glibc2.31-x86_64
path: OJ-*/
windows-mingw-gcc:
name: Build (Windows x86_64, MinGW, GCC)
needs: prepare
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: true
install: |
base-devel dos2unix w3m
pacboy: |
toolchain:p cmake:p ninja:p SDL2:p asciidoctor:p
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz
run: |
cmake --workflow --preset release
- name: Prepare artifact
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
cmake --install build-release --prefix $PWD
cp /mingw64/bin/SDL2.dll dist/
builds/ci/adoc2html ${SHORT_SHA} < res/unix/OpenJazz.6.adoc > dist/OpenJazzManual.html
builds/ci/docs2dist dist
mv dist OJ-${SHORT_SHA}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-windows-mingw-x86_64
path: OJ-*/
wii-devkitppc:
name: Build (Wii, devkitPPC)
needs: prepare
runs-on: ubuntu-latest
container: devkitpro/devkitppc:latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -yqq ninja-build dos2unix asciidoctor w3m
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz
run: |
$DEVKITPRO/portlibs/wii/bin/powerpc-eabi-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Prepare artifact
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
cmake --install build --prefix $PWD
builds/ci/adoc2txt ${SHORT_SHA} < res/unix/OpenJazz.6.adoc > OpenJazz/Manual.txt
builds/ci/docs2dist OpenJazz
mv OpenJazz OJ-${SHORT_SHA}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-wii
path: OJ-*/
n3ds-devkitarm:
name: Build (3DS, devkitARM)
needs: prepare
runs-on: ubuntu-latest
container: devkitpro/devkitarm:latest
steps:
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -yqq ninja-build dos2unix asciidoctor w3m
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz
run: |
$DEVKITPRO/portlibs/3ds/bin/arm-none-eabi-cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build
- name: Prepare artifact
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
cmake --install build --prefix $PWD
builds/ci/adoc2txt ${SHORT_SHA} < res/unix/OpenJazz.6.adoc > OpenJazz/Manual.txt
builds/ci/docs2dist OpenJazz
mv OpenJazz OJ-${SHORT_SHA}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-3ds
path: OJ-*/
riscos-gccsdk:
if: ${{ false }} # disable, since svn repository is offline/broken
name: Build (RISC OS, GCCSDK 4.7)
needs: prepare
runs-on: ubuntu-latest
container: riscosdotinfo/riscos-gccsdk-4.7:latest
steps:
- name: Install dependencies
run: |
apt-get update -qq
apt-get install -yqq cmake ninja-build
- name: Prepare GCCSDK autobuilder and build SDL
run: |
cp /usr/bin/false /usr/bin/automake-1.11 # autobuilder wants this, sdl does not need it
cp /usr/bin/false /usr/bin/meson # autobuilder wants this, sdl does not need it
svn co svn://svn.riscos.info/gccsdk/trunk/autobuilder/ autobuilder # todo: maybe use snapshot
mkdir sdl-build
cd sdl-build
../autobuilder/build -v libsdl1.2debian # todo: cache?
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz
run: |
cmake -G Ninja -B build . -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=/home/riscos/env/toolchain-riscos.cmake -DRISCOS=ON
cmake --build build
- name: Prepare artifact
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
cmake --install build --prefix $PWD
cp README.md COPYING licenses.txt !OpenJazz/
mkdir OJ-${SHORT_SHA}
mv !OpenJazz OJ-${SHORT_SHA}/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-riscos
path: OJ-*/
psp-pspdev:
name: Build (PSP, pspdev)
needs: prepare
runs-on: ubuntu-latest
container: pspdev/pspdev:latest
steps:
- name: Install dependencies
run: |
apk add git cmake ninja asciidoctor w3m
- name: Checkout
uses: actions/checkout@v4
- name: Build OpenJazz
run: |
cmake --preset=psp-release -DNETWORK=OFF
cmake --build --preset=psp-release
- name: Prepare artifact
env:
SHORT_SHA: ${{ needs.prepare.outputs.short_sha }}
run: |
cmake --install build-psp-release --prefix $PWD
builds/ci/adoc2txt ${SHORT_SHA} < res/unix/OpenJazz.6.adoc > OpenJazz/Manual.txt
builds/ci/docs2dist OpenJazz
mv OpenJazz OJ-${SHORT_SHA}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: openjazz-psp
path: OJ-*/
prerelease:
name: Create Pre-release
needs:
# all
- dist
- linux-clang
- windows-mingw-gcc
- wii-devkitppc
- n3ds-devkitarm
- riscos-gccsdk
- psp-pspdev
# allow run when some platform jobs failed, but not for tags
if: always() && !startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: repo
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Zip artifacts and inspect directory
run: |
mv openjazz-dist dist
repo/builds/ci/dir2zip openjazz-*
ls -l
- name: Create Pre-release and upload artifacts
uses: softprops/action-gh-release@v1
# only on master branch
if: github.ref == 'refs/heads/master'
with:
prerelease: true
tag_name: continuous
generate_release_notes: true
files: |
openjazz-*.*
dist/*.*