From 0387b336403d17f138d2607548bcbb8720e3536c Mon Sep 17 00:00:00 2001 From: AlphaCat Date: Tue, 3 Nov 2026 10:03:45 +0800 Subject: [PATCH] =?UTF-8?q?ci(release):=20Windows=20=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=94=B9=E8=A3=85=E5=AE=98=E6=96=B9=20protoc?= =?UTF-8?q?=EF=BC=8C=E5=AE=89=E8=A3=85=E5=A4=B1=E8=B4=A5=E5=8D=B3=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #1132 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/desktop-release.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml index efeab1a59..eaf05005a 100644 --- a/.github/workflows/desktop-release.yml +++ b/.github/workflows/desktop-release.yml @@ -219,10 +219,21 @@ jobs: - uses: dtolnay/rust-toolchain@stable + # 与 CI 和 Linux 发布任务一样装官方 release。choco 源出错时安装会失败, + # 但旧步骤最后一条命令是 Out-File,步骤仍显示成功,十几分钟后才在构建里报找不到 protoc。 - name: Install protobuf compiler + env: + PROTOC_VERSION: "34.0" run: | - choco install protoc -y --no-progress - "$env:ChocolateyInstall\lib\protoc\tools\bin" | Out-File -Append $env:GITHUB_PATH + $archive = Join-Path $env:RUNNER_TEMP "protoc.zip" + $destination = Join-Path $env:RUNNER_TEMP "protoc-$env:PROTOC_VERSION" + Invoke-WebRequest -Uri "https://github.com/protocolbuffers/protobuf/releases/download/v$env:PROTOC_VERSION/protoc-$env:PROTOC_VERSION-win64.zip" -OutFile $archive + Expand-Archive -Path $archive -DestinationPath $destination -Force + $protoc = Join-Path $destination "bin\protoc.exe" + & $protoc --version + if ($LASTEXITCODE -ne 0) { throw "protoc verification failed: $LASTEXITCODE" } + "PROTOC=$protoc" | Out-File -Append $env:GITHUB_ENV + (Split-Path $protoc) | Out-File -Append $env:GITHUB_PATH - uses: Swatinem/rust-cache@v2 with: