forked from diasurgical/devilutionX
-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (109 loc) · 3.89 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
---
name: Sega Dreamcast
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- dreamcast
- fix/ISSUE-8-libfmt-patch
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: 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: Download spawn.mpq
run: |
curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/spawn.mpq
- name: Download fonts.mpq
run: |
curl -LO https://github.com/diasurgical/devilutionx-assets/releases/download/v4/fonts.mpq
- name: Configure CMake
run: |
export KOS_SH4_PRECISION="-m4" && \
source /opt/toolchains/dc/kos/environ.sh && \
#uncomment when using packed mpq or 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: |
# patches libfmt to support long double
# patch build/_deps/libfmt-src/include/fmt/format.h -l -p0 < libfmt-long-double.patch
export KOS_SH4_PRECISION="-m4" && \
source /opt/toolchains/dc/kos/environ.sh && cd build && kos-make
- name: Generate .cdi
run: |
source /opt/toolchains/dc/kos/environ.sh && \
mv spawn.mpq build/data/ && \
mv fonts.mpq build/data/fonts/ && \
mkdcdisc -e build/devilutionx.elf -o build/devilutionx.cdi --name 'Diablo 1' -d build/data/
- name: Prepare elf package
run: rm build/data/spawn.mpq && rm build/data/fonts/fonts.mpq
- 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
...