Skip to content

Rename project to DoomGeo #116

Rename project to DoomGeo

Rename project to DoomGeo #116

Workflow file for this run

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: "4194304"
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-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-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-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-linux-helpers
build_name: doomgeo-build
plan_name: doomgeo-plan
- os: windows-2022
artifact: doomgeo-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-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-pages-rom
path: dist/pages-rom
- name: Download ASM ROM artifact
uses: actions/download-artifact@v4
with:
name: doomgeo-asm-rom
path: dist/asm-rom
- name: Build Pages bundle
run: python3 tools/doomgeo_build.py pages --rom dist/pages-rom/doomgeo.zip --bios dist/pages-rom/neogeo.zip --asm-rom dist/asm-rom/doomgeo-asm.zip --out dist/pages
- name: Verify FBNeo web package CRCs
run: |
python3 - <<'PY'
import binascii
import glob
import zipfile
expected_rom = {
"221-p1.p1": 0x7BE82353,
"221-s1.s1": 0x2A4063A3,
"221-c1.c1": 0x1F862A14,
"221-c2.c2": 0x14B90536,
"221-m1.m1": 0xBDDAE628,
"221-v1.v1": 0x7E5E53E4,
}
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.zip")
main_launch_rom = glob.glob("dist/pages/rom/web-*/magdrop2.zip")
main_bios = glob.glob("dist/pages/rom/web-*/neogeo.zip")
asm_rom = glob.glob("dist/pages/rom/asm/web-*/doomgeo-asm.zip")
asm_launch_rom = glob.glob("dist/pages/rom/asm/web-*/magdrop2.zip")
if len(main_rom) != 1 or len(main_launch_rom) != 1 or len(main_bios) != 1 or len(asm_rom) != 1 or len(asm_launch_rom) != 1:
raise SystemExit(
"unexpected web package layout: "
f"{main_rom=} {main_launch_rom=} {main_bios=} {asm_rom=} {asm_launch_rom=}"
)
check(main_rom[0], expected_rom)
check(main_rom[0], expected_bios)
check(main_launch_rom[0], expected_rom)
check(main_launch_rom[0], expected_bios)
check(asm_rom[0], expected_rom)
check(asm_rom[0], expected_bios)
check(asm_launch_rom[0], expected_rom)
check(asm_launch_rom[0], expected_bios)
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 }}