Repository navigation
526 lines (466 loc) · 19 KB
/
Copy pathbuild.yml
File metadata and controls
526 lines (466 loc) · 19 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
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
name: Build CI
on:
workflow_dispatch:
inputs:
version:
description: 'Version for installer (e.g. 6.1.0). Empty = skip.'
required: false
type: string
push:
branches: [ "master" ]
tags:
- 'ATARI800_*_*_*'
pull_request:
jobs:
build-amd64:
name: Build on Linux amd64
runs-on: ubuntu-24.04
container:
image: debian:bullseye
steps:
- uses: actions/checkout@v7
- name: install depends
run: |
apt-get update
apt-get install -y build-essential autoconf automake libtool pkg-config \
libsdl2-dev libmp3lame-dev libreadline-dev libgl1-mesa-dev libpng-dev libcurl4-openssl-dev curl ca-certificates
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --with-opengl --with-readline --with-mp3=lame --with-video=sdl2 --with-sound=sdl2
- name: building
run: make -j4
- name: Archive Atari800 binary
uses: actions/upload-artifact@v7
with:
name: atari800-linux-amd64
path: src/atari800
- name: Build AppImage
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
echo "VERSION=$V" >> $GITHUB_ENV
APPDIR="/tmp/Atari800-${V}.AppDir"
mkdir -p "$APPDIR/usr/bin" \
"$APPDIR/usr/share/applications" \
"$APPDIR/usr/share/icons/hicolor/128x128/apps" \
"$APPDIR/usr/share/icons/hicolor/scalable/apps"
cp src/atari800 "$APPDIR/usr/bin/"
cp debian/atari800.desktop "$APPDIR/usr/share/applications/"
cp data/atari1.png "$APPDIR/usr/share/icons/hicolor/128x128/apps/atari800.png"
cp data/atari2.svg "$APPDIR/usr/share/icons/hicolor/scalable/apps/atari800.svg"
ln -s usr/share/applications/atari800.desktop "$APPDIR/"
ln -s usr/share/icons/hicolor/128x128/apps/atari800.png "$APPDIR/atari800.png"
echo '#!/bin/sh' > "$APPDIR/AppRun"
echo 'HERE="$(dirname "$(readlink -f "$0")")"' >> "$APPDIR/AppRun"
echo 'exec "$HERE/usr/bin/atari800" "$@"' >> "$APPDIR/AppRun"
chmod +x "$APPDIR/AppRun"
curl -sL "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" \
-o /tmp/linuxdeploy
chmod +x /tmp/linuxdeploy
APPIMAGE_EXTRACT_AND_RUN=1 /tmp/linuxdeploy --appdir "$APPDIR"
# Find and bundle any missing transitive dependencies
for f in "$APPDIR/usr/bin/atari800" $(find "$APPDIR/usr/lib" -name '*.so*' -type f 2>/dev/null); do
ldd "$f" 2>/dev/null | grep -E '=> /' | awk '{print $3}' | while read -r dep; do
depname=$(basename "$dep")
if [ ! -f "$APPDIR/usr/lib/$depname" ] && [ ! -L "$APPDIR/usr/lib/$depname" ]; then
case "$depname" in
libc.so.*|libdl.so.*|libm.so.*|libpthread.so.*|librt.so.*|libresolv.so.*|libutil.so.*|libnss*|libnsl.so.*|libcrypt.so.*|ld-linux*)
;;
*)
cp -L "$dep" "$APPDIR/usr/lib/"
echo "Bundled missing dep: $depname"
;;
esac
fi
done
done
curl -sL "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" \
-o /tmp/appimagetool
chmod +x /tmp/appimagetool
APPIMAGE_EXTRACT_AND_RUN=1 /tmp/appimagetool "$APPDIR" "Atari800-${V}-x86_64.AppImage"
- name: Upload AppImage
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
uses: actions/upload-artifact@v7
with:
name: atari800-linux-appimage
path: Atari800-*.AppImage
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/ATARI800_')
run: |
gh release create "$GITHUB_REF_NAME" 2>/dev/null || true
gh release upload "$GITHUB_REF_NAME" Atari800-*-x86_64.AppImage --clobber
build-linux-i386:
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
name: Build on Linux i386
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Build and package in 32-bit Debian container
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
docker run --platform=linux/386 --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
-e V="$V" \
debian:bullseye \
bash -c "
set -e
apt-get update
apt-get install -y build-essential autoconf automake libtool pkg-config \
libsdl2-dev libmp3lame-dev libreadline-dev libpng-dev libcurl4-openssl-dev curl ca-certificates
./autogen.sh
./configure --with-video=sdl2 --with-sound=sdl2 --with-mp3=lame
make -j\$(nproc)
APPDIR=\"/tmp/Atari800-\${V}.AppDir\"
mkdir -p \"\$APPDIR/usr/bin\" \
\"\$APPDIR/usr/share/applications\" \
\"\$APPDIR/usr/share/icons/hicolor/128x128/apps\" \
\"\$APPDIR/usr/share/icons/hicolor/scalable/apps\"
cp src/atari800 \"\$APPDIR/usr/bin/\"
cp debian/atari800.desktop \"\$APPDIR/usr/share/applications/\"
cp data/atari1.png \"\$APPDIR/usr/share/icons/hicolor/128x128/apps/atari800.png\"
cp data/atari2.svg \"\$APPDIR/usr/share/icons/hicolor/scalable/apps/atari800.svg\"
ln -s usr/share/applications/atari800.desktop \"\$APPDIR/\"
ln -s usr/share/icons/hicolor/128x128/apps/atari800.png \"\$APPDIR/atari800.png\"
echo '#!/bin/sh' > \"\$APPDIR/AppRun\"
echo 'HERE=\"\$(dirname \"\$(readlink -f \"\$0\")\")\"' >> \"\$APPDIR/AppRun\"
echo 'exec \"\$HERE/usr/bin/atari800\" \"\$@\"' >> \"\$APPDIR/AppRun\"
chmod +x \"\$APPDIR/AppRun\"
curl -sL \"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-i386.AppImage\" \
-o /tmp/linuxdeploy
chmod +x /tmp/linuxdeploy
APPIMAGE_EXTRACT_AND_RUN=1 /tmp/linuxdeploy --appdir \"\$APPDIR\"
# Find and bundle any missing transitive dependencies
for f in \"\$APPDIR/usr/bin/atari800\" \$(find \"\$APPDIR/usr/lib\" -name '*.so*' -type f 2>/dev/null); do
ldd \"\$f\" 2>/dev/null | grep -E '=> /' | awk '{print \$3}' | while read -r dep; do
depname=\$(basename \"\$dep\")
if [ ! -f \"\$APPDIR/usr/lib/\$depname\" ] && [ ! -L \"\$APPDIR/usr/lib/\$depname\" ]; then
case \"\$depname\" in
libc.so.*|libdl.so.*|libm.so.*|libpthread.so.*|librt.so.*|libresolv.so.*|libutil.so.*|libnss*|libnsl.so.*|libcrypt.so.*|ld-linux*)
;;
*)
cp -L \"\$dep\" \"\$APPDIR/usr/lib/\"
echo \"Bundled missing dep: \$depname\"
;;
esac
fi
done
done
curl -sL \"https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage\" \
-o /tmp/appimagetool
chmod +x /tmp/appimagetool
APPIMAGE_EXTRACT_AND_RUN=1 /tmp/appimagetool \"\$APPDIR\" \"Atari800-\${V}-i386.AppImage\"
"
- name: Upload AppImage
uses: actions/upload-artifact@v7
with:
name: atari800-linux-i386-appimage
path: Atari800-*.AppImage
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/ATARI800_')
run: |
gh release create "$GITHUB_REF_NAME" 2>/dev/null || true
gh release upload "$GITHUB_REF_NAME" Atari800-*-i386.AppImage --clobber
build-macos:
name: Build on MacOS M1 (arm64)
runs-on: macos-14
steps:
- uses: actions/checkout@v7
- name: install depends
env:
HOMEBREW_REQUIRE_TAP_TRUST: 0
run: brew install sdl2 automake readline dylibbundler
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure --with-opengl --with-video=sdl2 --with-sound=sdl2
- name: building
run: make -j4
- name: Package .dmg
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
echo "VERSION=$V" >> $GITHUB_ENV
APP="Atari800.app"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources" "$APP/Contents/lib"
cp src/atari800 "$APP/Contents/MacOS/"
dylibbundler -od -b -x "$APP/Contents/MacOS/atari800" \
-d "$APP/Contents/lib/" -p @executable_path/../lib/
mkdir -p Atari800.iconset
for size in 16 32 48 128 256 512; do
sips -z $size $size data/atari1.png \
--out "Atari800.iconset/icon_${size}x${size}.png" >/dev/null 2>&1
done
sips -z 32 32 data/atari1.png \
--out Atari800.iconset/icon_16x16@2x.png >/dev/null 2>&1
sips -z 64 64 data/atari1.png \
--out Atari800.iconset/icon_32x32@2x.png >/dev/null 2>&1
sips -z 256 256 data/atari1.png \
--out Atari800.iconset/icon_128x128@2x.png >/dev/null 2>&1
sips -z 512 512 data/atari1.png \
--out Atari800.iconset/icon_256x256@2x.png >/dev/null 2>&1
iconutil -c icns Atari800.iconset
cp Atari800.icns "$APP/Contents/Resources/"
{
echo '<?xml version="1.0" encoding="UTF-8"?>'
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"'
echo ' "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'
echo '<plist version="1.0">'
echo '<dict>'
echo ' <key>CFBundleDevelopmentRegion</key>'
echo ' <string>English</string>'
echo ' <key>CFBundleExecutable</key>'
echo ' <string>atari800</string>'
echo ' <key>CFBundleIconFile</key>'
echo ' <string>Atari800</string>'
echo ' <key>CFBundleIdentifier</key>'
echo ' <string>org.atari800.atari800</string>'
echo ' <key>CFBundleInfoDictionaryVersion</key>'
echo ' <string>6.0</string>'
echo ' <key>CFBundleName</key>'
echo ' <string>Atari800</string>'
echo ' <key>CFBundlePackageType</key>'
echo ' <string>APPL</string>'
echo ' <key>CFBundleShortVersionString</key>'
echo " <string>${V}</string>"
echo ' <key>CFBundleVersion</key>'
echo " <string>${V}</string>"
echo ' <key>NSHighResolutionCapable</key>'
echo ' <true/>'
echo '</dict>'
echo '</plist>'
} > "$APP/Contents/Info.plist"
codesign --deep --force --verify=strict --sign - "$APP" 2>/dev/null || true
hdiutil create -volname "Atari800 ${V}" -srcfolder "$APP" \
-ov -format UDZO "Atari800-${V}-macos-arm64.dmg"
- name: Upload DMG
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
uses: actions/upload-artifact@v7
with:
name: atari800-macos-arm64-dmg
path: Atari800-*.dmg
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/ATARI800_')
run: |
gh release create "$GITHUB_REF_NAME" 2>/dev/null || true
gh release upload "$GITHUB_REF_NAME" Atari800-*-macos-arm64.dmg --clobber
- name: Archive Atari800 binary
uses: actions/upload-artifact@v7
with:
name: atari800-macos-arm64
path: src/atari800
build-windows-msys2:
name: Build on Windows MSYS2
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
base-devel
mingw-w64-x86_64-toolchain
autoconf
automake
libtool
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-readline
mingw-w64-x86_64-libpng
mingw-w64-x86_64-nsis
mingw-w64-x86_64-lame
mingw-w64-x86_64-curl
zip
- name: Run autoreconf
run: autoreconf -fiv
- name: Configure project
run: ./configure --with-video=sdl2 --with-sound=sdl2 --with-mp3=lame
- name: Build project
run: make -j$(nproc)
- name: Verify build
run: |
if [ ! -f src/atari800.exe ]; then
echo "Build failed"
exit 1
fi
echo "Build succeeded"
- name: Embed app icon
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
run: |
cd src
windres --include-dir .. -i atari800_res.rc -o atari800_res_icon.o
rm -f atari800.exe
make atari800.exe atari800_LDADD="atari800_res_icon.o"
- name: Archive plain binary
uses: actions/upload-artifact@v7
with:
name: atari800-windows-msys2
path: src/atari800.exe
- name: Stage files and build installer
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
shell: msys2 {0}
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
echo "VERSION=$V" >> $GITHUB_ENV
mkdir -p pkg/act pkg/doc
cp src/atari800.exe pkg/
ldd src/atari800.exe | grep '\/mingw64\/bin\/' | \
awk '{print $3}' | xargs -I{} cp {} pkg/
cp README.TXT pkg/
cp act/*.act pkg/act/
cp data/atari800.ico pkg/
cp COPYING pkg/doc/COPYING.txt
cp DOC/INSTALL pkg/doc/INSTALL.txt
cp DOC/NEWS pkg/doc/NEWS.txt
cp DOC/USAGE pkg/doc/USAGE.txt
makensis -DVERSION=$V -DPLATFORM=win64 atari800.nsi
(cd pkg && zip -r "../atari800-${V}-win64.zip" .)
- name: Verify installer
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
shell: msys2 {0}
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
test -f atari800-$V-win64.zip && echo "Installer OK: atari800-$V-win64.zip"
- name: Archive portable zip
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
uses: actions/upload-artifact@v7
with:
name: atari800-${{ env.VERSION }}-win64-portable
path: atari800-*-win64.zip
- name: Archive installer exe
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
uses: actions/upload-artifact@v7
with:
name: atari800-${{ env.VERSION }}-win64-installer
path: atari800-*-win64.exe
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/ATARI800_')
run: |
gh release create "$GITHUB_REF_NAME" 2>/dev/null || true
gh release upload "$GITHUB_REF_NAME" atari800-*-win64.exe atari800-*-win64.zip --clobber
build-windows-msys2-32:
if: startsWith(github.ref, 'refs/tags/ATARI800_') || inputs.version != ''
name: Build on Windows MSYS2 (32-bit)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v7
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: >-
git
base-devel
mingw-w64-i686-toolchain
autoconf automake libtool
mingw-w64-i686-SDL2
mingw-w64-i686-readline
mingw-w64-i686-libpng
mingw-w64-i686-nsis
mingw-w64-i686-lame
mingw-w64-i686-curl
zip
- name: Run autoreconf
run: autoreconf -fiv
- name: Configure project
run: ./configure --with-video=sdl2 --with-sound=sdl2 --with-mp3=lame --disable-download
- name: Build project
run: make -j$(nproc)
- name: Verify build
run: |
test -f src/atari800.exe && echo "Build succeeded"
- name: Embed app icon
run: |
cd src
windres --include-dir .. -i atari800_res.rc -o atari800_res_icon.o
rm -f atari800.exe
make atari800.exe atari800_LDADD="atari800_res_icon.o"
- name: Archive plain binary
uses: actions/upload-artifact@v7
with:
name: atari800-windows-msys2-32
path: src/atari800.exe
- name: Stage files and build installer
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
echo "VERSION=$V" >> $GITHUB_ENV
mkdir -p pkg/act pkg/doc
cp src/atari800.exe pkg/
for dll in SDL2.dll libmp3lame-0.dll libpng16-16.dll libreadline8.dll libtermcap-0.dll libwinpthread-1.dll zlib1.dll; do
find /mingw32/bin -name "$dll" -exec cp {} pkg/ \; 2>/dev/null || true
done
find /mingw32/bin -name "libgcc_s_dw2-1.dll" -exec cp {} pkg/ \; 2>/dev/null || true
cp README.TXT pkg/
cp act/*.act pkg/act/
cp data/atari800.ico pkg/
cp COPYING pkg/doc/COPYING.txt
cp DOC/INSTALL pkg/doc/INSTALL.txt
cp DOC/NEWS pkg/doc/NEWS.txt
cp DOC/USAGE pkg/doc/USAGE.txt
makensis -DVERSION=$V -DPLATFORM=win32-no-network atari800.nsi
(cd pkg && zip -r "../atari800-${V}-win32-no-network.zip" .)
- name: Verify installer
run: |
if [ -n "${{ inputs.version }}" ]; then
V=${{ inputs.version }}
else
V=${GITHUB_REF_NAME#ATARI800_}
V=${V//_/.}
fi
test -f atari800-$V-win32-no-network.zip && echo "Installer OK: atari800-$V-win32-no-network.zip"
- name: Archive portable zip
uses: actions/upload-artifact@v7
with:
name: atari800-${{ env.VERSION }}-win32-no-network-portable
path: atari800-*-win32-no-network.zip
- name: Archive installer exe
uses: actions/upload-artifact@v7
with:
name: atari800-${{ env.VERSION }}-win32-no-network-installer
path: atari800-*-win32-no-network.exe
- name: Attach to release
if: startsWith(github.ref, 'refs/tags/ATARI800_')
run: |
gh release create "$GITHUB_REF_NAME" 2>/dev/null || true
gh release upload "$GITHUB_REF_NAME" atari800-*-win32-no-network.exe atari800-*-win32-no-network.zip --clobber