Update msbuild.yml #12
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
name: CMake Build with MinGW and vcpkg | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
BUILD_TYPE: Release # 或 Debug,根据需要设置 | |
jobs: | |
build: | |
runs-on: windows-latest # 使用 GitHub 提供的 Windows 环境 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install MinGW and vcpkg | |
run: | | |
# 安装 MinGW | |
choco install mingw | |
# 克隆 vcpkg | |
git clone https://github.com/microsoft/vcpkg.git | |
cd vcpkg | |
# 初始化 vcpkg 并安装所需的库 | |
./bootstrap-vcpkg.bat | |
./vcpkg install unofficial-webview2 fmt simpleini | |
- name: Configure CMake with MinGW and vcpkg | |
run: | | |
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -G "MinGW Makefiles" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
- name: Build the project with MinGW | |
run: | | |
cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} |