Skip to content

Commit

Permalink
Add Emscripten build
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Feb 11, 2021
1 parent 5ec03dc commit 6b3973a
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:

env:
BUILD_TYPE: Release
EM_VERSION: 2.0.4 # Emscripten version
EM_CACHE_FOLDER: 'emsdk-cache' # Cache for Emscripten libs

jobs:

Expand All @@ -34,6 +36,13 @@ jobs:
cmake-args: -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/32blit-sdk/32blit.toolchain
apt-packages: gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib python3-setuptools

- os: ubuntu-20.04
name: Emscripten
release-suffix: WEB
cmake-args: -D32BLIT_DIR=$GITHUB_WORKSPACE/32blit-sdk
cmake-prefix: emcmake
apt-packages: python3-setuptools

- os: macos-latest
name: macOS
release-suffix: MACOS
Expand Down Expand Up @@ -85,6 +94,26 @@ jobs:
run: |
python -m pip install 32blit
# Emscripten SDK setup
- name: Setup Emscripten cache
if: matrix.name == 'Emscripten'
id: cache-system-libraries
uses: actions/cache@v2
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{runner.os}}

- name: Setup Emscripten
if: matrix.name == 'Emscripten'
uses: mymindstorm/setup-emsdk@v7
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

- name: Pre-build Emscripten ports
if: matrix.name == 'Emscripten'
run: embuilder.py build sdl2 sdl2-image-jpg sdl2-net

# Set up the cmake build environment
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/main/build
Expand All @@ -93,7 +122,7 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/main/build
run: cmake $GITHUB_WORKSPACE/main -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}}
run: ${{matrix.cmake-prefix}} cmake $GITHUB_WORKSPACE/main -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCPACK_PACKAGE_FILE_NAME=${{env.RELEASE_FILE}} ${{matrix.cmake-args}}

# And then run the build itself
- name: Build
Expand Down

0 comments on commit 6b3973a

Please sign in to comment.