Skip to content

Commit

Permalink
finalize github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
westlicht committed Jun 7, 2022
1 parent 053aeb0 commit dac9d12
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 86 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CI

on:
push:
branches: [ "master" ]
tags: v*
pull_request:
branches: [ "master" ]

Expand All @@ -23,8 +21,8 @@ jobs:
- name: Deploy
run: make deploy
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
draft: true
files: build/deploy/**/*
Expand Down Expand Up @@ -60,3 +58,31 @@ jobs:
run: (cd build/sim/release && make -j)
- name: Test
run: (cd build/sim/release && make test)
sim_wasm:
name: Simulation Platform (WebAssembly)
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup emsdk
run: |
git clone https://github.com/emscripten-core/emsdk.git
./emsdk/emsdk install latest
./emsdk/emsdk activate latest
- name: Setup
run: |
source ./emsdk/emsdk_env.sh
make setup_www
- name: Build
run: (cd build/sim/www && make -j)
- name: Deploy
run: make deploy-simulator
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: JamesIves/github-pages-deploy-action@v4.3.3
with:
branch: gh-pages
folder: build/deploy-simulator
target-folder: _pages/testdrive/sequencer
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ setup_sim:

.PHONY: setup_www
setup_www:
(mkdir -p build/sim/www && cd build/sim/www && cmake -DCMAKE_TOOLCHAIN_FILE="${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake" -DCMAKE_BUILD_TYPE=Release -DPLATFORM=sim ../../..)
(mkdir -p build/sim/www && cd build/sim/www && cmake -DCMAKE_TOOLCHAIN_FILE="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" -DCMAKE_BUILD_TYPE=Release -DPLATFORM=sim ../../..)

# Deployment

Expand Down
22 changes: 4 additions & 18 deletions scripts/deploy-simulator
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
#!/bin/sh

BUILD_DIR=build/sim/www/src/apps/sequencer
TESTDRIVE_DIR=_pages/testdrive
DEPLOY_DIR=build/deploy-simulator

# clone gh-pages repository
git clone --branch=gh-pages https://${GH_PAGES_TOKEN}@github.com/westlicht/performer.git gh-pages

# copy simulator files
cp ${BUILD_DIR}/sequencer.* gh-pages/${TESTDRIVE_DIR}

# commit simulator files
cd gh-pages
git config --global user.email "travis@travis-ci.com"
git config --global user.name "Travis CI"
git add ${TESTDRIVE_DIR}/sequencer.*
git commit --message "Travis simulator build: $TRAVIS_BUILD_NUMBER"
git push
cd ..

# remove gh-pages repository
rm -rf gh-pages
rm -rf ${DEPLOY_DIR}
mkdir ${DEPLOY_DIR}
cp ${BUILD_DIR}/sequencer.* ${DEPLOY_DIR}
2 changes: 1 addition & 1 deletion src/platform/sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SDL2

if(${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
set(SDL_FLAGS "-s USE_SDL=2 -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 --preload-file ${CMAKE_CURRENT_SOURCE_DIR}/assets@/assets")
set(SDL_FLAGS "-s USE_SDL=2 --preload-file ${CMAKE_CURRENT_SOURCE_DIR}/assets@/assets")
set(CMAKE_EXECUTABLE_SUFFIX ".html" PARENT_SCOPE)
else()
find_package(SDL2 REQUIRED)
Expand Down

0 comments on commit dac9d12

Please sign in to comment.