Skip to content

Dreamcast Port

Dreamcast Port #7

Workflow file for this run

---
name: Sega Dreamcast
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- dreamcast
- fix/ISSUE-15-unpacked-mpqs
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
container: azihassan/kallistios:docker
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build unpack_and_minify_mpq
run: |
git clone https://github.com/diasurgical/devilutionx-mpq-tools/ && \
cd devilutionx-mpq-tools && \
cmake -S. -Bbuild-rel -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF && \
cmake --build build-rel && \
cmake --install build-rel
- name: Download and unpack spawn.mpq
run: |
#devilutionx-assets spawn.mpq fails with unpack_and_minify_mpq
#curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/spawn.mpq
curl -LO https://github.com/raw/d07RiV/diabloweb/3a5a51e84d5dab3cfd4fef661c46977b091aaa9c/spawn.mpq
unpack_and_minify_mpq spawn.mpq --output-dir data
rm spawn.mpq
- name: Download and unpack fonts.mpq
run: |
curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/fonts.mpq && \
unpack_and_minify_mpq fonts.mpq --output-dir data/fonts && \
rm fonts.mpq
- name: Uninstall kos-ports SDL 1.2
run: |
source /opt/toolchains/dc/kos/environ.sh && \
cd /opt/toolchains/dc/kos-ports/SDL && \
make uninstall || echo 'SDL 1.2 uninstall finished with non zero status, proceding anyway'
- name: Install GPF SDL 1.2
run: |
git clone -b SDL-dreamhal--GLDC https://github.com/GPF/SDL-1.2 && \
cd SDL-1.2 && \
source /opt/toolchains/dc/kos/environ.sh && \
make -f Makefile.dc && \
cp /opt/toolchains/dc/kos/addons/lib/dreamcast/libSDL.a /usr/lib/ && \
cp include/* /usr/include/SDL/
- name: Configure CMake
run: |
source /opt/toolchains/dc/kos/environ.sh && \
#uncomment when using packed save files
#without this, cmake can't find the kos-ports bzip2 & zlib libraries
#export CMAKE_PREFIX_PATH=/opt/toolchains/dc/kos-ports/libbz2/inst/:/opt/toolchains/dc/kos-ports/zlib/inst/ && \
kos-cmake \
-S . \
-DCMAKE_BUILD_TYPE=Release \
-B build
- name: Build DevilutionX
run: |
source /opt/toolchains/dc/kos/environ.sh && cd build && kos-make
- name: Generate .cdi
run: |
source /opt/toolchains/dc/kos/environ.sh && \
mv data/spawn build/data/spawn && \
mv data/fonts/fonts/fonts/ build/data/fonts/ && \
mkdcdisc -e build/devilutionx.elf -o build/devilutionx.cdi --name 'Diablo 1' -d build/data/
- name: Prepare elf package
run: rm -rf build/data/spawn && rm -rf build/data/fonts/fonts/
- name: Upload .elf Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx
path: |
build/data
build/devilutionx.elf
- name: Upload .cdi Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx.cdi
path: ./build/devilutionx.cdi
- name: Prepare Releases
if: ${{ github.event_name == 'release' && !env.ACT }}
run: |
apk add zip && \
cd build && \
zip -r devilutionx-dreamcast.zip data/ devilutionx.elf && \
zip -r devilutionx-dreamcast.cdi.zip devilutionx.cdi
- name: Update Release .cdi
if: ${{ github.event_name == 'release' && !env.ACT }}
uses: svenstaro/upload-release-action@v2
with:
file: ./build/devilutionx-dreamcast.cdi.zip
overwrite: true
- name: Update Release .elf
if: ${{ github.event_name == 'release' && !env.ACT }}
uses: svenstaro/upload-release-action@v2
with:
file: ./build/devilutionx-dreamcast.zip
overwrite: true