From d53b8f6684e2fef06955d2d2771ef694a45ca294 Mon Sep 17 00:00:00 2001 From: WMJ Date: Mon, 31 Aug 2026 20:23:30 +0800 Subject: [PATCH] change workflow --- .github/workflows/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1cb35c..3893904 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,12 +10,23 @@ on: jobs: build-and-sign: - runs-on: windows-2019 + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 + # 安装 .NET Framework 4.0 Targeting Pack + - name: Install .NET Framework 4.0 Targeting Pack + shell: pwsh + run: | + $vsInstallPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath + Write-Host "VS Install Path: $vsInstallPath" + $installerPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" + & $installerPath modify --installPath $vsInstallPath ` + --add Microsoft.Net.Component.4.TargetingPack ` + --passive --norestart + # .NET Framework 4.0 项目需用 MSBuild,不能用 dotnet build - name: Setup MSBuild uses: microsoft/setup-msbuild@v2