forked from chocolate-doom/chocolate-doom
-
Notifications
You must be signed in to change notification settings - Fork 132
177 lines (159 loc) · 4.77 KB
/
main.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
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
name: Continuous Integration
on:
push:
branches:
- "master"
tags:
- "*"
paths-ignore:
- "**.md"
pull_request:
branches:
- "master"
paths-ignore:
- "**.md"
workflow_dispatch:
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
strategy:
fail-fast: false
matrix:
config:
- name: Linux GCC
os: ubuntu-latest
compiler: gcc
shell: bash
- name: macOS Clang
os: macos-latest
compiler: clang
shell: bash
artifacts: true
pkg-path: pkg/osx/*.dmg
pkg-dir: pkg/osx
- name: macOS x86 Clang
os: macos-13
compiler: clang
shell: bash
artifacts: true
pkg-path: pkg/osx/*.dmg
pkg-dir: pkg/osx
- name: MSYS2 UCRT64
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: ucrt64
msys-env: mingw-w64-ucrt-x86_64
artifacts: true
pkg-path: pkg/win32/*.zip
pkg-dir: pkg/win32
- name: MSYS2 MINGW32
os: windows-latest
compiler: gcc
shell: 'msys2 {0}'
msystem: mingw32
msys-env: mingw-w64-i686
artifacts: true
pkg-path: pkg/win32/*.zip
pkg-dir: pkg/win32
steps:
- name: Install pandoc
if: runner.os == 'Windows'
shell: cmd
run: choco install pandoc
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install \
python3-yaml \
libsdl2-dev \
libsdl2-mixer-dev \
libsdl2-net-dev \
libpng-dev \
libsamplerate0-dev \
libfluidsynth-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install \
automake \
sdl2 \
sdl2_mixer \
sdl2_net \
libpng \
libsamplerate \
python3 \
fluid-synth
# Since we're running CI inside a VM it doesn't really
# matter if we're "breaking" anything:
pip3 install --break-system-packages pyyaml
- name: Install dependencies (MSYS2)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.msystem }}
update: true
path-type: inherit
install: >-
autotools
zip
${{ matrix.config.msys-env }}-gcc
${{ matrix.config.msys-env }}-SDL2
${{ matrix.config.msys-env }}-SDL2_mixer
${{ matrix.config.msys-env }}-SDL2_net
${{ matrix.config.msys-env }}-libpng
${{ matrix.config.msys-env }}-libsamplerate
${{ matrix.config.msys-env }}-fluidsynth
${{ matrix.config.msys-env }}-python3-yaml
- uses: actions/checkout@v4
with:
submodules: true
- name: Configure
env:
CC: ${{ matrix.config.compiler }}
run: |
./autogen.sh
- name: Build true-color on Windows
if: runner.os == 'Windows'
run: |
make distclean
./configure --enable-truecolor
make -j4
for i in doom heretic hexen strife ; do mv src/crispy-${i}.exe src/crispy-${i}-truecolor.exe ; done
make distclean
./configure
- name: Build
run: make -j4
- name: Test
run: |
PREFIX=`sed -n '/PROGRAM_PREFIX/p' ${PWD}/config.h | cut -d '"' -f 2`
make -j4 -C quickcheck check SOURCE_PORT=$PWD/src/${PREFIX}doom
- name: Package
if: ${{ matrix.config.artifacts }}
run: |
cd ${{ matrix.config.pkg-dir }}
make
- name: Upload artifacts
if: ${{ matrix.config.artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.name }}
path: ${{ matrix.config.pkg-path }}
- name: Extract Package String
if: ${{ contains(github.ref, 'tags') }}
run: |
PACKAGE_STRING=`sed -n '/PACKAGE_STRING/p' ${PWD}/config.h | cut -d '"' -f 2`
echo "PACKAGE_STRING=${PACKAGE_STRING}" >> $GITHUB_ENV
- name: Release
if: ${{ contains(github.ref, 'tags') && matrix.config.artifacts }}
uses: ncipollo/release-action@v1
with:
name: ${{ env.PACKAGE_STRING }}
bodyFile: RELEASE_NOTES.md
allowUpdates: true
artifacts: ${{ matrix.config.pkg-path }}