forked from diasurgical/devilutionX
-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (126 loc) · 4.9 KB
/
dreamcast.yml
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
---
name: Sega Dreamcast
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- dreamcast
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://raw.githubusercontent.com/d07RiV/diabloweb/3a5a51e84d5dab3cfd4fef661c46977b091aaa9c/spawn.mpq
unpack_and_minify_mpq spawn.mpq
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 && \
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
# diabdat.mpq isn't available so this doesn't do anything, but I'll leave it here for documentation purposes
- name: Patch RAM-heavy assets
if: ${{ hashFiles('DIABDAT.MPQ') != '' }}
run: |
unpack_and_minify_mpq DIABDAT.MPQ && \
cp blackd.clx diabdat/monsters/black/blackd.clx && \
cp diablod.clx diabdat/monsters/diablo/diablod.clx && \
cp diablon.clx diabdat/monsters/diablo/diablon.clx && \
cp maged.clx diabdat/monsters/mage/maged.clx && \
patch build/data/txtdata/monsters/monstdat.tsv -l -p0 < monstdat.patch
- name: Generate .cdi
run: |
source /opt/toolchains/dc/kos/environ.sh && \
mv spawn build/data/spawn && \
mv 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