Skip to content

Make local MSVC build independent of builtin-baseline (#21) #28

Make local MSVC build independent of builtin-baseline (#21)

Make local MSVC build independent of builtin-baseline (#21) #28

Workflow file for this run

name: MSVC-Win64
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Get latest VCPKG commit
shell: bash
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
export LATEST_COMMIT=$(git rev-parse HEAD)
echo "LATEST_COMMIT=$LATEST_COMMIT" >> $GITHUB_ENV
- name: Update builtin-baseline in vcpkg.json
shell: bash
run: |
jq --arg commit "$LATEST_COMMIT" '. + {"builtin-baseline": $commit}' vcpkg.json > temp.json && mv temp.json vcpkg.json
- name: Install vcpkg
run: |
.\vcpkg\bootstrap-vcpkg.bat
- name: Remove vcpkg.json for classic mode
shell: bash
run: |
if [ -f "vcpkg.json" ]; then
rm "vcpkg.json"
fi
- name: Install Dependencies with vcpkg
run: |
.\vcpkg\vcpkg.exe install sdl2 sdl2-mixer[libflac,libmodplug,mpg123,opusfile] libsamplerate --triplet x64-windows-static-release --overlay-triplets=cmake/triplets
- name: Configure CMake
run: |
cmake -B build_vs_64 -S . -DCMAKE_BUILD_TYPE=Release `
-DENABLE_LTO=ON `
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets" `
-DVCPKG_TARGET_TRIPLET="x64-windows-static-release" `
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW `
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake
- name: Build
run: cmake --build build_vs_64 --config Release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: cry-dev-win64
path: build_vs_64/src/Release/*.exe
retention-days: 90