Add web demo instructions, clean up confusing inputs in streamer rom #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |