-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (54 loc) · 1.9 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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