-
Notifications
You must be signed in to change notification settings - Fork 0
264 lines (225 loc) · 8.43 KB
/
build-emulators.yaml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
name: Build Emulators
on:
push: # Trigger for pushes.
branches:
- main
paths:
- emulator-patches/**
- software/player/**
- common/**
- .github/workflows/build-emulators.yaml
pull_request: # Trigger for pull requests.
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: # Allows for manual triggering.
inputs:
ref:
description: "The ref to build."
required: false
type: string
for-release:
description: "True if we should upload artifacts for a release."
default: false
type: boolean
workflow_call: # Allows for another workflow to call this one.
inputs:
ref:
description: "The ref to build."
required: true
type: string
for-release:
description: "True if we should upload artifacts for a release."
default: false
type: boolean
# If another instance of this workflow is started for the same PR, cancel the
# old one. If a PR is updated and a new test run is started, the old test run
# will be cancelled automatically to conserve resources.
concurrency:
group: build-emulators-${{ inputs.ref || github.ref }}
cancel-in-progress: true
jobs:
build-blastem-linux:
name: Build BlastEm for Linux
runs-on: ubuntu-latest
steps:
- name: Checkout BlastEm
uses: actions/checkout@v4
with:
repository: libretro/blastem
ref: 277e4a62668597d4f59cadda1cbafb844f981d45
path: .
- name: Checkout Kinetoscope
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ inputs.ref || github.ref }}
path: kinetoscope
- name: Apply patch
run: patch -p1 -i kinetoscope/emulator-patches/blastem-0.6.2.patch
- name: Get source deps for portable build
run: |
sudo apt -y install libgl-dev libglu1-mesa-dev libpulse-dev
wget -O glew-2.1.0.tgz https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download
tar xf glew-2.1.0.tgz
ln -s glew-2.1.0 glew
wget -O SDL2-2.30.3.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz
tar xf SDL2-2.30.3.tar.gz
ln -s SDL2-2.30.3 sdl
wget -O curl-8.8.0.tar.gz https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.gz
tar xf curl-8.8.0.tar.gz
ln -s curl-8.8.0 curl
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
- name: Build portable binaries
run: OS=Linux ./build_release
- name: Upload blastem binaries
uses: actions/upload-artifact@v4
if: inputs.for-release
with:
name: blastem-linux
path: blastem-0.6.2-kinetoscope
retention-days: 1
build-blastem-windows:
name: Build BlastEm for Windows (cross-compile)
runs-on: ubuntu-latest
steps:
- name: Checkout BlastEm
uses: actions/checkout@v4
with:
repository: libretro/blastem
ref: 277e4a62668597d4f59cadda1cbafb844f981d45
path: .
- name: Checkout Kinetoscope
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ inputs.ref || github.ref }}
path: kinetoscope
- name: Apply patch
run: patch -p1 -i kinetoscope/emulator-patches/blastem-0.6.2.patch
- name: Get binary and source deps for portable build
run: |
sudo apt -y install mingw-w64
wget -O glew-2.2.0-win32.zip https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip
unzip glew-2.2.0-win32.zip
ln -s glew-2.2.0 glew
wget -O SDL2-devel-2.30.8-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.8/SDL2-devel-2.30.8-mingw.tar.gz
tar xf SDL2-devel-2.30.8-mingw.tar.gz
ln -s SDL2-2.30.8 sdl
wget -O curl-8.8.0.tar.gz https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.gz
tar xf curl-8.8.0.tar.gz
ln -s curl-8.8.0 curl
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
- name: Symlink mingw compilers to ccache
run: |
for name in \
x86_64-w64-mingw32-gcc-win32 \
x86_64-w64-mingw32-gcc; do
sudo ln -s $(which ccache) /usr/local/bin/$name
done
- name: Build portable binaries
run: OS=Win64 ./build_release
- name: Upload blastem binaries
uses: actions/upload-artifact@v4
if: inputs.for-release
with:
name: blastem-windows
path: blastem-0.6.2-kinetoscope
retention-days: 1
build-blastem-macos:
name: Build BlastEm for macOS
runs-on: macos-13 # x86-64 explicitly, since BlastEm won't build on arm64
steps:
- name: Checkout BlastEm
uses: actions/checkout@v4
with:
repository: libretro/blastem
ref: 277e4a62668597d4f59cadda1cbafb844f981d45
path: .
- name: Checkout Kinetoscope
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ inputs.ref || github.ref }}
path: kinetoscope
- name: Apply patch
run: patch -p1 -i kinetoscope/emulator-patches/blastem-0.6.2.patch
- name: Get source deps for portable build
run: |
wget -O glew-2.1.0.tgz https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download
tar xf glew-2.1.0.tgz
ln -s glew-2.1.0 glew
wget -O SDL2-2.30.3.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.30.3/SDL2-2.30.3.tar.gz
tar xf SDL2-2.30.3.tar.gz
ln -s SDL2-2.30.3 sdl
wget -O curl-8.8.0.tar.gz https://github.com/curl/curl/releases/download/curl-8_8_0/curl-8.8.0.tar.gz
tar xf curl-8.8.0.tar.gz
ln -s curl-8.8.0 curl
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
create-symlink: true
- name: Build portable binaries
run: OS=Darwin ./build_release
- name: Upload blastem binaries
uses: actions/upload-artifact@v4
if: inputs.for-release
with:
name: blastem-macos
path: blastem-0.6.2-kinetoscope
retention-days: 1
build-genesis-plus-gx-web:
name: Build Genesis Plus GX for web
runs-on: ubuntu-latest
steps:
- name: Checkout Genesis Plus GX
uses: actions/checkout@v4
with:
repository: libretro/Genesis-Plus-GX
ref: 7de0f0b6cde9bda1235b448aa607044b3f80ab3c
path: .
- name: Checkout Kinetoscope
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ inputs.ref || github.ref }}
path: core/kinetoscope
- name: Checkout RetroArch
uses: actions/checkout@v4
with:
repository: libretro/RetroArch
ref: fbf2c70e0df88cbe9bf74752834592cf5613fca9
path: retroarch
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.46
# This triggers the SDK to be cached
actions-cache-folder: 'emsdk-cache'
- name: Apply patch
run: patch -p1 -i core/kinetoscope/emulator-patches/genesis-plus-gx.patch
# Instructions based on
# https://github.com/libretro/RetroArch/blob/master/pkg/emscripten/README.md
- name: Build Genesis Plus GX Core
run: |
# Build the Genesis Plux GX core
emmake make -f Makefile.libretro platform=emscripten
# Copy it into RetroArch's build
cp *_libretro_emscripten.bc retroarch/libretro_emscripten.bc
# Go to RetroArch
cd retroarch
# Build support infrastructure and perform final linking step
emmake make -f Makefile.emscripten LIBRETRO=genesis_plus_gx 'LIBS=-s USE_ZLIB=1 -s FETCH=1' -j all
# Outputs are genesis_plus_gx_libretro.*
cp genesis_plus_gx_libretro.* ../
- name: Upload libretro wasm core
uses: actions/upload-artifact@v4
if: inputs.for-release
with:
name: genesis-plus-gx-web
path: genesis_plus_gx_libretro.*
retention-days: 1