Skip to content

fix(release): skip GitHub Packages publish when version already exists - #47

Merged
OLDyade merged 2 commits into
mainfrom
fix-grc-release
Jul 29, 2026
Merged

fix(release): skip GitHub Packages publish when version already exists#47
OLDyade merged 2 commits into
mainfrom
fix-grc-release

Conversation

@dongjiang1989

@dongjiang1989 dongjiang1989 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:

This is dry-run pass?
Originally posted by @dongjiang1989 in #45 (comment)

Fixes the release workflow failure at https://github.com/iflytek/memflywheel/actions/runs/30351326253/job/90249842896

Summary

The release workflow fails with 409 Conflict when re-pushing an existing tag because GitHub Packages does not allow overwriting published versions.

npm error 409 Conflict - PUT https://npm.pkg.github.com/@iflytek%2fmemflywheel - Cannot publish over existing version

This PR adds a pre-publish check in scripts/publish-npm.mjs:

  • versionExistsOnRegistry() uses npm view to check if the version already exists on GitHub Packages
  • If it exists, skip with a [SKIP] message instead of failing
  • Makes re-running the release workflow (e.g. re-pushing a tag) idempotent

Checks

  • pnpm run ci
  • No old project names, private paths, credentials, or AI-signature footers
  • Package metadata still points to iflytek/memflywheel
  • Core does not call LLMs directly
  • Recall remains full-index, with no embedding/BM25/top-k/vector retrieval

Special notes for reviewers

Only scripts/publish-npm.mjs is changed — no impact on core packages, adapters, plugins, or e2e tests.

The release workflow fails with 409 Conflict when re-pushing a tag
because GitHub Packages does not allow overwriting existing versions.

Add versionExistsOnRegistry() check before publishing — if the version
already exists, skip with a [SKIP] message instead of failing.

Signed-off-by: dongjiang <dongjiang1989@126.com>
Comment thread scripts/publish-npm.mjs Fixed
Signed-off-by: dongjiang <dongjiang1989@126.com>

@OLDyade OLDyade left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. This makes release reruns idempotent without hiding real registry or authentication failures, and the change stays cleanly scoped to the GitHub Packages path. All checks are green.

@OLDyade
OLDyade merged commit 75dc723 into main Jul 29, 2026
10 checks passed
@OLDyade
OLDyade deleted the fix-grc-release branch July 29, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants