Skip to content

Add demo

Add demo #16

Workflow file for this run

name: Demo Runner
on:
pull_request:
branches: [main]
push:
tags:
- v**
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
runner: [macos-latest, windows-latest]
include:
- generator: Xcode
runner: macos-latest
name: macOS
- generator: Visual Studio 17
runner: windows-latest
name: Windows
name: Build Demo ${{matrix.name}}
runs-on: ${{matrix.runner}}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: CMake Configure
run: cmake -Bbuild -G "${{matrix.generator}}" -DJIVE_BUILD_DEMO_RUNNER=ON
- name: CMake Build
run: cmake --build build --config "${{env.BUILD_TYPE}}"
- name: Stage artifacts
run: |
mkdir ./artifacts
if [[ $(uname) == "Darwin" ]]; then
for app in "$(find ./build/runners/demo-runner -name '*.app')"; do
mv "${app}" ./artifacts;
done
mv ./build/version.txt ./artifacts
elif [[ $(uname) == *"MINGW"* ]]; then
for exe in "$(find -wholename './build/runners/demo-runner/*.exe')"; do
cp -r "${exe}" ./artifacts;
done
fi
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ./artifacts
release:
if: contains(github.ref, 'tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: .
- name: Set VERSION variable
run: |
VERSION_TXT=$(cat ./artifacts/version.txt)
echo "VERSION=$VERSION_TXT" >> $GITHUB_ENV
rm ./artifacts/version.txt
- name: Make zip
run: |
name="JIVE ${{env.VERSION}}"
mv ./artifacts/ "./$name/"
zip -r "$(name).zip" "./$name/"
- name: Release
uses: softprops/action-gh-release@v1
with:
name: "JIVE ${{env.VERSION}}"
files: ./*.zip