From 8c053bfd62a7119d13240743c01fcd7a9e14b4b8 Mon Sep 17 00:00:00 2001 From: Changhua Date: Wed, 30 Apr 2025 01:55:30 +0800 Subject: [PATCH] chore(ci): fix build script --- .github/workflows/build-ci.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index d1ac553..ce0529d 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -44,19 +44,11 @@ jobs: run: | if (!(Test-Path 'C:/Tools')) { New-Item -ItemType Directory -Force -Path 'C:/Tools' | Out-Null } cd C:/Tools - git clone --depth 1 https://github.com/microsoft/vcpkg vcpkg - # 加一次简单重试,防网络抖动 + git clone --single-branch https://github.com/microsoft/vcpkg vcpkg $retry = 0 while ($retry -lt 3) { - try { - .\vcpkg\bootstrap-vcpkg.bat - break - } catch { - $retry++ - if ($retry -ge 3) { throw } - Write-Host "bootstrap 失败,重试第 $retry 次..." - Start-Sleep -Seconds 15 - } + try { .\vcpkg\bootstrap-vcpkg.bat -disableMetrics ; break } + catch { $retry++; if ($retry -ge 3) { throw }; Write-Host "bootstrap 失败,重试第 $retry 次..." ; Start-Sleep 15 } } - name: 设置 VCPKG_ROOT