-
-
Notifications
You must be signed in to change notification settings - Fork 4
473 lines (464 loc) · 16.8 KB
/
build.yml
File metadata and controls
473 lines (464 loc) · 16.8 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
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
name: Core Builds
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-win64:
name: Windows 64-bit
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: git make mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake
- name: Submodule Cache Key
shell: pwsh
run: |
echo "SDLHASH=$($(git submodule status SDL) -replace '\s','')" >> $env:GITHUB_ENV
echo "ZLIBHASH=$($(git submodule status zlib) -replace '\s','')" >> $env:GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-win64-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
shell: msys2 {0}
run: |
make -f makefile.zlib
make -f makefile.sdl
- name: Build hatariB
shell: msys2 {0}
run: make
- name: Prepare Artifact
shell: pwsh
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
copy build/*.dll artifact/cores
mkdir artifact/info
copy info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $env:GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-win64--${{ env.BUILD_TAG }}
path: artifact/
build-win32:
name: Windows 32-bit
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: git make mingw-w64-i686-gcc mingw-w64-i686-cmake
- name: Submodule Cache Key
shell: pwsh
run: |
echo "SDLHASH=$($(git submodule status SDL) -replace '\s','')" >> $env:GITHUB_ENV
echo "ZLIBHASH=$($(git submodule status zlib) -replace '\s','')" >> $env:GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-win32-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
shell: msys2 {0}
run: |
make -f makefile.zlib
make -f makefile.sdl
- name: Build hatariB
shell: msys2 {0}
run: make
- name: Prepare Artifact
shell: pwsh
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
copy build/*.dll artifact/cores
mkdir artifact/info
copy info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $env:GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-win32--${{ env.BUILD_TAG }}
path: artifact/
build-ubuntu:
name: Ubuntu Linux
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc cmake
- name: Submodule Cache Key
run: |
echo "SDLHASH=$(git submodule status SDL | tr -d '[:blank:]')" >> $GITHUB_ENV
echo "ZLIBHASH=$(git submodule status zlib | tr -d '[:blank:]')" >> $GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-ubuntu-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
run: |
make -f makefile.zlib
make -f makefile.sdl
- name: Build hatariB
run: make
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-ubuntu--${{ env.BUILD_TAG }}
path: artifact/
build-macos:
name: MacOS Fat
runs-on: macos-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Submodule Cache Key
run: |
echo "SDLHASH=$(git submodule status SDL | tr -d '[:blank:]')" >> $GITHUB_ENV
echo "ZLIBHASH=$(git submodule status zlib | tr -d '[:blank:]')" >> $GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build_arm
zlib_build_intel
key: sub-macos-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
run: |
export CC=clang
export CFLAGS="-target arm64-apple-macos11"
export ZLIB_BUILD=zlib_build_arm
make -f makefile.zlib
export CFLAGS="-target x86_64-apple-macos10.13"
export ZLIB_BUILD=zlib_build_intel
make -f makefile.zlib
export CFLAGS=
export CC=$(PWD)/SDL/build-scripts/clang-fat.sh
make -f makefile.sdl
- name: Build hatariB
run: |
export CC_OLD=$CC
export BD=build_arm
export HBD=build_arm
export ZLIB_BUILD=zlib_build_arm
export CMAKEFLAGS="-DCMAKE_C_COMPILER=clang -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_SYSTEM_NAME=Darwin"
make hatarilib
export CC=clang
export CFLAGS="-target arm64-apple-macos11"
export LDFLAGS="-target arm64-apple-macos11"
make core
export BD=build_intel
export HBD=build_intel
export ZLIB_BUILD=zlib_build_intel
export CC=$CC_OLD
export CFLAGS=
export LDFLAGS=
export CMAKEFLAGS="-DCMAKE_C_COMPILER=clang -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_NAME=Darwin"
make hatarilib
export CC=clang
export CFLAGS="-target x86_64-apple-macos10.13"
export LDFLAGS="-target x86_64-apple-macos10.13"
make core
strip -u -r build_arm/hatarib.dylib
strip -u -r build_intel/hatarib.dylib
mkdir -p build
lipo -create -output build/hatarib.dylib build_arm/hatarib.dylib build_intel/hatarib.dylib
- name: Prepare Signature
if: github.event_name != 'pull_request'
env:
CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
run: echo $CERTIFICATE | base64 --decode -o certificate.p12
- name: Sign Dylib
if: github.event_name != 'pull_request'
uses: indygreg/apple-code-sign-action@v1.0
with:
input_path: build/hatarib.dylib
p12_file: certificate.p12
p12_password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.dylib artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-macos--${{ env.BUILD_TAG }}
path: artifact/
build-rpi64:
name: Raspberry Pi OS 64-bit
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc gcc-aarch64-linux-gnu cmake
- name: Submodule Cache Key
run: |
echo "SDLHASH=$(git submodule status SDL | tr -d '[:blank:]')" >> $GITHUB_ENV
echo "ZLIBHASH=$(git submodule status zlib | tr -d '[:blank:]')" >> $GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-rpi64-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
run: |
export CC=aarch64-linux-gnu-gcc
export AR=aarch64-linux-gnu-gcc-ar
make -f makefile.zlib
export RANLIB=aarch64-linux-gnu-gcc-ranlib
export CONFIGURE_FLAGS="--build=x86_64-linux --host=aarch64-linux-gnu --target=aarch64-linux-gnu-gcc"
make -f makefile.sdl
- name: Build hatariB
run: |
export CC=aarch64-linux-gnu-gcc
export CMAKEFLAGS="-DCMAKE_SYSTEM_NAME=aarch64-linux-gnu -DHAVE_DLOPEN=1"
make
# CMAKE_SYSTEM_NAME informs cmake that we are cross-compiling, so that it knows to build and run cpugen natively.
# HAVE_DLOPEN=1 is forced because cmake fails to find it for RPi, yet it seems perfectly available.
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-rpi64--${{ env.BUILD_TAG }}
path: artifact/
build-rpi32:
name: Raspberry Pi OS 32-bit
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc gcc-arm-linux-gnueabihf cmake
- name: Submodule Cache Key
run: |
echo "SDLHASH=$(git submodule status SDL | tr -d '[:blank:]')" >> $GITHUB_ENV
echo "ZLIBHASH=$(git submodule status zlib | tr -d '[:blank:]')" >> $GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-rpi32-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
run: |
export CC=arm-linux-gnueabihf-gcc
export AR=arm-linux-gnueabihf-gcc-ar
make -f makefile.zlib
export RANLIB=arm-linux-gnueabihf-gcc-ranlib
export CONFIGURE_FLAGS="--build=x86_64-linux --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf-gcc"
make -f makefile.sdl
- name: Build hatariB
run: |
export CC=arm-linux-gnueabihf-gcc
export CMAKEFLAGS="-DCMAKE_SYSTEM_NAME=arm-linux-gnueabihf -DHAVE_DLOPEN=1"
make
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-rpi32--${{ env.BUILD_TAG }}
path: artifact/
build-android64:
name: Android 64-bit
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc cmake
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Submodule Cache Key
run: |
echo "SDLHASH=$(git submodule status SDL | tr -d '[:blank:]')" >> $GITHUB_ENV
echo "ZLIBHASH=$(git submodule status zlib | tr -d '[:blank:]')" >> $GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-android64-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
run: |
export API=26
export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC="$TOOLCHAIN/aarch64-linux-android$API-clang"
export AR="$TOOLCHAIN/llvm-ar"
make -f makefile.zlib
export RANLIB="$TOOLCHAIN/llvm-ranlib"
export CONFIGURE_FLAGS="--build=x86_64-linux --host=aarch64-linux-android --target=$CC"
export SDL_JOYSTICK_DISABLE=
export SDL_HAPTIC_DISABLE=
make -f makefile.sdl
- name: Build hatariB
run: |
export API=26
export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC="$TOOLCHAIN/aarch64-linux-android$API-clang"
export CMAKEFLAGS="-DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=$API"
make
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-android64--${{ env.BUILD_TAG }}
path: artifact/
build-android32:
name: Android 32-bit
runs-on: ubuntu-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
- name: Setup Ubuntu
run: |
sudo apt-get update
sudo apt-get install make gcc cmake
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Submodule Cache Key
run: |
echo "SDLHASH=$(git submodule status SDL | tr -d '[:blank:]')" >> $GITHUB_ENV
echo "ZLIBHASH=$(git submodule status zlib | tr -d '[:blank:]')" >> $GITHUB_ENV
- name: Cache Submodules
id: cache-sub
uses: actions/cache@v4
with:
path: |
SDL/build
zlib_build
key: sub-android32-${{ env.SDLHASH }}-${{ env.ZLIBHASH }}
- name: Build SDL2 and zlib
if: steps.cache-sub.outputs.cache-hit != 'true'
run: |
export API=26
export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC="$TOOLCHAIN/armv7a-linux-androideabi$API-clang"
export AR="$TOOLCHAIN/llvm-ar"
make -f makefile.zlib
export RANLIB="$TOOLCHAIN/llvm-ranlib"
export CONFIGURE_FLAGS="--build=x86_64-linux --host=armv7a-linux-androideabi --target=$CC"
export SDL_JOYSTICK_DISABLE=
export SDL_HAPTIC_DISABLE=
make -f makefile.sdl
- name: Build hatariB
run: |
export API=26
export TOOLCHAIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC="$TOOLCHAIN/armv7a-linux-androideabi$API-clang"
export CMAKEFLAGS="-DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=$API"
make
- name: Prepare Artifact
run: |
mkdir artifact
cp README.md artifact
mkdir artifact/cores
cp build/*.so artifact/cores
mkdir artifact/info
cp info/*.* artifact/info
echo "BUILD_TAG=$(git log -1 --format="%ad--%h" --date=format-local:"%Y-%m-%d-%H%M%S")" >> $GITHUB_ENV
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: hatarib-android32--${{ env.BUILD_TAG }}
path: artifact/