Repository navigation
ci(publish): npm publish 失败时自动重试,已发布的版本视为成功 - #86
Merged
Merged
Conversation
Provenance signing can fail transiently, as the v0.7.86 release did on @c4a/context-cli with a Sigstore transparency-log 409. Retry each package up to three times, 30 seconds apart, and stop as soon as the registry shows the version, because a failed attempt may still have published it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
发布工作流对单个包的
npm publish失败自动重试,并在 registry 已出现该版本时视为成功。Compatibility
None. 只改
.github/workflows/publish.yml的发布步骤;包内容、版本与发布顺序不变。Verification
见下方「自测情况」。
Checklist
bun run verify:fullpasses.(未改代码)背景
v0.7.86 发布时,
@c4a/context-cli的 provenance 签名遇到 Sigstore transparency log 的临时 409("an equivalent entry already exists"),整个发布任务失败,需要人工 re-run。工作流已会跳过已发布的包,但单个包没有重试。改动
::warning::注明第几次。::error::并以非零退出,行为与原来一致。未纳入:去掉
markdown-it-cjk-friendly自动安装的 peermarkdown-it@15。唯一的办法是把插件源码复制进仓库,会失去由上游维护规则的好处;多装的这个包本身无害。风险
重试只在发布失败时发生;最坏情况多等 60 秒。不会重复发布同一版本(npm 也会拒绝)。
向后兼容
无影响。
自测情况
publish.ymlYAML 解析通过;发布步骤脚本bash -n通过。npm跑发布循环的三种情况:先失败后成功(尝试 2 次,退出 0);失败但已发布(尝试 1 次,识别为已发布,退出 0);一直失败(尝试 3 次,退出 1)。🤖 Generated with Claude Code