From a6912d182ae8cd7ee339f9e61897141c84fca403 Mon Sep 17 00:00:00 2001 From: UltimeLam <35449771+UltimeLam@users.noreply.github.com> Date: Fri, 27 Nov 2026 15:46:40 +0800 Subject: [PATCH] =?UTF-8?q?chore(cli):=20=E5=8F=91=E5=B8=83=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=94=B9=E7=94=A8=20prefer-online=20=E5=B9=B6?= =?UTF-8?q?=E6=94=BE=E5=AE=BD=E8=BD=AE=E8=AF=A2=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 16560b7..4d4349c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -54,13 +54,13 @@ jobs: run: | name=$(node -p "require('./package.json').name") version=$(node -p "require('./package.json').version") - # npm CDN 的元数据传播实测 2–4 分钟:轮询 5 分钟再判失败,避免把延迟当成没发 - for i in $(seq 1 20); do - if npm view "$name@$version" version >/dev/null 2>&1; then + # npm CDN 边缘节点可能继续返回旧 packument:强制在线取,并放宽到 10 分钟再判失败 + for i in $(seq 1 40); do + if npm view --prefer-online "$name@$version" version >/dev/null 2>&1; then echo "$name@$version 已在 registry 上" exit 0 fi sleep 15 done - echo "::error::$name@$version 发布后 5 分钟仍查不到,检查 Publish 步骤日志" + echo "::error::$name@$version 发布后 10 分钟仍查不到,检查 Publish 步骤日志" exit 1