diff --git a/.github/workflows/Build-WeChatFerry.yml b/.github/workflows/Build-WeChatFerry.yml index ff42865..2c28c46 100644 --- a/.github/workflows/Build-WeChatFerry.yml +++ b/.github/workflows/Build-WeChatFerry.yml @@ -58,25 +58,28 @@ jobs: cd C:/Tools # 克隆并引导 vcpkg - git clone https://github.com/microsoft/vcpkg || echo "vcpkg already cloned" + if (!(Test-Path -Path 'C:/Tools/vcpkg')) { + git clone https://github.com/microsoft/vcpkg + } .\vcpkg\bootstrap-vcpkg.bat # 设置 VCPKG_ROOT 环境变量 + setx VCPKG_ROOT "C:/Tools/vcpkg" /M echo "VCPKG_ROOT=C:/Tools/vcpkg" >> $GITHUB_ENV - # 将 vcpkg 与 Visual Studio 集成 - .\vcpkg\vcpkg integrate install - # 返回到项目目录并安装依赖 cd ${{ github.workspace }} - C:/Tools/vcpkg/vcpkg install --triplet x64-windows + vcpkg install --triplet x64-windows + + # 将 vcpkg 与 Visual Studio 集成 + vcpkg integrate install - name: 解析并构建配置 run: | $configurations = "Release,Debug".Split(',') foreach ($config in $configurations) { Write-Host "Building configuration: $config" - msbuild WeChatFerry/WeChatFerry.sln /p:Configuration=$config /p:Platform="x64" /verbosity:detailed + msbuild WeChatFerry/WeChatFerry.sln /p:Configuration=$config /p:Platform="x64" /verbosity:minimal } shell: pwsh