forked from lantus/NGRayEx
-
Notifications
You must be signed in to change notification settings - Fork 3
303 lines (259 loc) · 9.15 KB
/
Copy pathbuild.yml
File metadata and controls
303 lines (259 loc) · 9.15 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
name: Build
on:
push:
branches:
- doom-neogeo-port
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
PAGES_DOOM_IWAD: .tools/assets/freedoom-0.13.0.zip
PAGES_DOOM_CROM_FILE_BYTES: "2097152"
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
rom:
name: Neo Geo ROM
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ngdevkit
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common curl zip imagemagick sox libsox-fmt-mp3 python3-pil python3-ruamel.yaml
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
sudo apt-get update
sudo apt-get install -y ngdevkit ngdevkit-gngeo
- name: Verify helper scripts
run: |
python3 -m py_compile tools/doomgeo_build.py tools/doomgeo_plan.py
python3 tools/doomgeo_build.py doctor --tools-prefix /usr
python3 tools/doomgeo_plan.py list
make DOOM_MAP=E1M1 BUILDDIR=build/ci-ripdoom-e1m1 ripdoom-check ripdoom-runtime-check
make DOOM_MAP=E1M2 BUILDDIR=build/ci-ripdoom-e1m2 ripdoom-check ripdoom-runtime-check
- name: Build ROM
run: python3 tools/doomgeo_build.py build --tools-prefix /usr
- name: Collect ROM artifacts
run: python3 tools/doomgeo_build.py package --out dist/rom
- name: Upload ROM
uses: actions/upload-artifact@v4
with:
name: doomgeo-aes-rom
path: dist/rom/*
if-no-files-found: error
asm-rom:
name: 68000 ASM ROM
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ngdevkit
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common zip
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
sudo apt-get update
sudo apt-get install -y ngdevkit ngdevkit-gngeo
- name: Build ASM ROM
run: python3 tools/doomgeo_build.py build --tools-prefix /usr --target asm-rom
- name: Collect ASM ROM artifacts
run: python3 tools/doomgeo_build.py package --variant asm --out dist/asm-rom
- name: Upload ASM ROM
uses: actions/upload-artifact@v4
with:
name: doomgeo-aes-asm-rom
path: dist/asm-rom/*
if-no-files-found: error
pages-rom:
name: GitHub Pages Freedoom ROM
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ngdevkit
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common curl zip imagemagick sox libsox-fmt-mp3 python3-pil python3-ruamel.yaml
sudo add-apt-repository -y ppa:dciabrin/ngdevkit
sudo apt-get update
sudo apt-get install -y ngdevkit ngdevkit-gngeo
- name: Download Freedoom IWAD
run: make "${PAGES_DOOM_IWAD}"
- name: Build web-safe Freedoom ROM
run: |
make cart bios \
TOOLS_PREFIX=/usr \
DOOM_IWAD="${PAGES_DOOM_IWAD}" \
DOOM_CROM_FILE_BYTES="${PAGES_DOOM_CROM_FILE_BYTES}"
- name: Collect Pages ROM artifacts
run: python3 tools/doomgeo_build.py package --out dist/pages-rom
- name: Upload Pages ROM
uses: actions/upload-artifact@v4
with:
name: doomgeo-aes-pages-rom
path: dist/pages-rom/*
if-no-files-found: error
helpers:
name: Standalone helpers (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
artifact: doomgeo-aes-linux-helpers
build_name: doomgeo-build
plan_name: doomgeo-plan
- os: windows-2022
artifact: doomgeo-aes-windows-helpers
build_name: doomgeo-build.exe
plan_name: doomgeo-plan.exe
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PyInstaller
run: python -m pip install --upgrade pip pyinstaller
- name: Build standalone helpers
shell: bash
run: |
pyinstaller --onefile --name doomgeo-build tools/doomgeo_build.py
pyinstaller --onefile --name doomgeo-plan tools/doomgeo_plan.py
- name: Smoke test standalone helpers
shell: bash
run: |
./dist/${{ matrix.build_name }} --help
./dist/${{ matrix.build_name }} install --help
./dist/${{ matrix.build_name }} build --help
./dist/${{ matrix.build_name }} package --help
./dist/${{ matrix.plan_name }} list
- name: Upload standalone helpers
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: |
dist/${{ matrix.build_name }}
dist/${{ matrix.plan_name }}
if-no-files-found: error
windows-rom:
name: Windows MSYS2 ROM
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up MSYS2 UCRT64
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
git
pactoys
python
make
zip
unzip
- name: Install ngdevkit for MSYS2
shell: msys2 {0}
run: python3 tools/doomgeo_build.py install --method msys2
- name: Verify Windows build helper
shell: msys2 {0}
run: |
python3 -m py_compile tools/doomgeo_build.py tools/doomgeo_plan.py
python3 tools/doomgeo_build.py doctor --tools-prefix /ucrt64
python3 tools/doomgeo_plan.py list
- name: Build ROM on Windows
shell: msys2 {0}
run: python3 tools/doomgeo_build.py build --tools-prefix /ucrt64
- name: Collect Windows ROM artifacts
shell: msys2 {0}
run: python3 tools/doomgeo_build.py package --out dist/windows-rom
- name: Upload Windows-built ROM
uses: actions/upload-artifact@v4
with:
name: doomgeo-aes-windows-rom
path: dist/windows-rom/*
if-no-files-found: error
pages:
name: GitHub Pages playable build
runs-on: ubuntu-24.04
needs:
- rom
- pages-rom
- asm-rom
if: github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Pages ROM artifact
uses: actions/download-artifact@v4
with:
name: doomgeo-aes-pages-rom
path: dist/pages-rom
- name: Download ASM ROM artifact
uses: actions/download-artifact@v4
with:
name: doomgeo-aes-asm-rom
path: dist/asm-rom
- name: Build Pages bundle
run: python3 tools/doomgeo_build.py pages --rom dist/pages-rom/doomgeo-aes.zip --bios dist/pages-rom/neogeo.zip --asm-rom dist/asm-rom/doomgeo-aes-asm.zip --out dist/pages
- name: Verify FBNeo web package CRCs
run: |
python3 - <<'PY'
import binascii
import glob
import zipfile
expected_rom = {
"202-p1.p1": 0x2B61415B,
"202-s1.s1": 0xCD19264F,
"202-c1.c1": 0xCC0095EF,
"202-c2.c2": 0x42371307,
"202-m1.m1": 0x9C0291EA,
"202-v1.v1": 0xDEBEB8FB,
}
expected_bios = {
"sp-s3.sp1": 0x91B64BE3,
"sm1.sm1": 0x94416D67,
"sfix.sfix": 0xC2EA0CFD,
"000-lo.lo": 0x5A86CFF2,
}
def check(path, expected):
with zipfile.ZipFile(path) as archive:
for name, crc in expected.items():
data = archive.read(name)
actual = binascii.crc32(data) & 0xFFFFFFFF
if actual != crc:
raise SystemExit(f"{path}:{name} CRC {actual:08x} != {crc:08x}")
main_rom = glob.glob("dist/pages/rom/web-*/doomgeo-aes.zip")
main_bios = glob.glob("dist/pages/rom/web-*/neogeo.zip")
asm_rom = glob.glob("dist/pages/rom/asm/web-*/doomgeo-aes-asm.zip")
if len(main_rom) != 1 or len(main_bios) != 1 or len(asm_rom) != 1:
raise SystemExit(f"unexpected web package layout: {main_rom=} {main_bios=} {asm_rom=}")
check(main_rom[0], expected_rom)
check(asm_rom[0], expected_rom)
check(main_bios[0], expected_bios)
PY
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages-${{ github.run_attempt }}
path: dist/pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: github-pages-${{ github.run_attempt }}