Update app.cpp #6
Workflow file for this run
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: Publish to releases and github.io website | |
on: | |
push: | |
tags: | |
- "v*.*" | |
- "v*.*.*" | |
workflow_dispatch: | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules | |
jobs: | |
build_macos: | |
name: Build on macOS | |
runs-on: macos-latest | |
steps: | |
- name: Install dependencies | |
run: brew install ninja create-dmg | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v3 | |
with: | |
path: "**/cpm_modules" | |
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} | |
# Setup caching of build artifacts to reduce total build time (only Linux and MacOS) | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
key: macos-release | |
- name: Configure CMake | |
run: | | |
cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_POLICY_DEFAULT_CMP0135=NEW -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --parallel 4 --config ${{env.BUILD_TYPE}} | |
- name: Checking that Samplin Safari runs | |
run: | | |
${{github.workspace}}/build/Samplin\ Safari.app/Contents/MacOS/Samplin\ Safari --help | |
- name: Creating dmg | |
run: | | |
RESULT="${{github.workspace}}/build/SamplinSafari.dmg" | |
test -f $RESULT && rm $RESULT | |
create-dmg --window-size 500 300 --icon-size 96 --volname "Samplin Safari Installer" --app-drop-link 360 105 --icon Samplin\ Safari.app 130 105 $RESULT ${{github.workspace}}/build/Samplin\ Safari.app | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{github.workspace}}/build/SamplinSafari.dmg | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_windows: | |
name: Build on Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# - name: Fetch newer Windows SDK | |
# uses: fbactions/[email protected] | |
# with: | |
# winsdk-build-version: 19041 | |
# - name: Get WSL | |
# uses: Vampire/[email protected] | |
# - name: Setup MSBuild.exe | |
# uses: microsoft/[email protected] | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_POLICY_DEFAULT_CMP0135=NEW | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --parallel --config ${{env.BUILD_TYPE}} --verbose | |
- name: Checking that Samplin Safari runs | |
run: | | |
"${{github.workspace}}/build/${{env.BUILD_TYPE}}/Samplin Safari.exe --help" | |
- name: Release | |
uses: softprops/[email protected] | |
with: | |
files: | | |
${{github.workspace}}/build/${{env.BUILD_TYPE}}/Samplin Safari.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_emscripten: | |
name: Build and deploy emscripten webapp | |
runs-on: macos-12 | |
steps: | |
- name: Install dependencies | |
run: | | |
brew install ninja emscripten | |
python3 -m pip install Pillow | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v3 | |
with: | |
path: "**/cpm_modules" | |
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} | |
# Setup caching of build artifacts to reduce total build time (only Linux and MacOS) | |
- name: ccache | |
uses: hendrikmuhs/[email protected] | |
- name: Create Build Environment | |
run: cmake -E make_directory ${{github.workspace}}/build | |
- name: Configure CMake | |
run: | | |
emcmake cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --parallel 4 | |
- name: Copy web app | |
working-directory: ${{github.workspace}}/build | |
run: | | |
mkdir deploy | |
cp Samplin\ Safari.data Samplin\ Safari.html Samplin\ Safari.js Samplin\ Safari.wasm SamplinSafari_favicon.png FileSaver.js deploy/ | |
mv deploy/Samplin\ Safari.html deploy/index.html | |
- name: Publish | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ${{github.workspace}}/build/deploy |