forked from heyManNice/myCopilot
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.37 KB
/
msbuild.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
name: CMake + vcpkg Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# Step 1: Set up vcpkg manually
- name: Install vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git ${VCPKG_ROOT}
./vcpkg/bootstrap-vcpkg.bat # 对于 Windows 使用 bootstrap-vcpkg.bat
# Step 2: Install dependencies with vcpkg
- name: Install dependencies with vcpkg
run: |
./vcpkg install webview2 fmt simpleini # 安装 WebView2, fmt 和 simpleini
./vcpkg integrate install
# Step 3: Set up MSBuild and Visual Studio 16.9
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v2
with:
vs-version: '16.9' # 使用 Visual Studio 16.9 版本
# Step 4: Configure CMake
- name: Configure CMake
run: |
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 16 2019" ..
# Step 5: Build project with MSBuild
- name: Build project
run: |
cd build
msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} ${env.SOLUTION_FILE_PATH}