Skip to content

Commit 7ec9682

Browse files
committed
ci: skip-existing on PyPI publish to unblock concurrent PR pushes
When a PR is pushed multiple times in quick succession (or two CI runs race), the version-bump step can compute the same next version twice because PyPI's JSON API has a small cache window after a release. The second 'Publish to PyPI' then fails with HTTP 400 "File already exists", marking the entire CI run red and blocking PR merge even though tests, type-check, build and verify all passed. Add skip-existing: true so the publish action treats an existing version as a non-error (it logs a warning and exits 0). PR merge is no longer gated by this race. Side note: skip-existing means the second push's *content* won't be republished under the same version. The proper long-term fix is to embed the commit SHA in the dev version (e.g. 0.0.187+sha.<short>) so each push gets a unique artefact. Tracked separately. release-test.yml is intentionally left unchanged: it is triggered manually with an explicit version bump, where a conflict should fail loudly rather than be silently skipped. Change-Id: I4be2fb05fd06e32b83dd64d52bd62bfe8b8355cf Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: OhYee <oyohyee@oyohyee.com>
1 parent 5523af3 commit 7ec9682

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ jobs:
163163
with:
164164
password: ${{ secrets.PYPI_API_TOKEN }}
165165
verify-metadata: false
166+
# 当 PR 多次 push 或并发 CI 跑出相同版本号时,跳过已存在版本而非报错。
167+
# 根因是版本号自增逻辑依赖 PyPI API 拉取最新版本,存在缓存/并发窗口。
168+
# 不阻塞 PR 合入即可,长期方案是在版本号中嵌入 commit SHA 实现唯一化。
169+
skip-existing: true
166170

167171
- name: Create and push tag
168172
if: steps.changes.outputs.agentrun_changed == 'true'

0 commit comments

Comments
 (0)