Update CMake presets and use newer vcpkg baseline and other CI update… #101
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
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- main | |
name: ci | |
jobs: | |
build_opengl_backend: | |
name: OpenGL | |
strategy: | |
fail-fast: false | |
matrix: | |
window_toolkit: [glfw3, sdl2] | |
os: [windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@master | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
- name: Configure and Build | |
env: | |
FG_TOOLKIT: ${{ matrix.window_toolkit }} | |
run: | | |
mkdir build && cd build | |
cmake ` | |
-DCMAKE_TOOLCHAIN_FILE:FILEPATH="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" ` | |
-DFG_USE_WINDOW_TOOLKIT:STRING=$Env:FG_TOOLKIT .. | |
cmake --build . --parallel --target ALL_BUILD --config Release | |
cmake --build . --parallel --target INSTALL --config Release | |
cpack -G NSIS64 -C Release | |
- name: Upload release binary | |
if: matrix.window_toolkit == 'glfw3' && startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
$tokens = $env:GITHUB_REF -split "/" | |
$tag = $tokens[2] | |
$ver = $tag.substring(1) | |
gh release upload $tag ./build/Forge-$ver.exe --clobber |