GeezerVison is showing github.com — ci: move the npm latest tag from a workflow, and after every release by jasdeepkhalsa · Pull Request #263 · DBDiff/DBDiff
Conversation
Pre-releases publish to npm under their own tag (rc), so npm install @dbdiff/cli kept resolving to an older version until latest was moved by hand.
New: npm-dist-tag.yml (Actions → Move npm dist-tag → Run workflow)
- Inputs: a published
version and a tag (default latest).
- Moves the tag on
@dbdiff/cli and all eight platform packages together. Platform packages go first and the root last, since the root is what people install.
- The move itself runs
scripts/npm-promote-latest.sh, the script already used to move tags locally. Before touching anything it checks every package has that version on npmjs.org. If any is missing, nothing moves.
- Before a stable release:
latest can point at any pre-release.
- After a stable release:
latest only follows stable releases. It refuses a pre-release, and refuses a stable version older than the current latest (e.g. a 3.0.x patch after 3.1.0).
- Other tags (
rc, beta, …) can be moved freely.
Release integration
release.yml gains an npm-latest job that calls the same workflow after publish-npm.
- When the guard refuses, it skips with a notice rather than failing the release. Run by hand, a refusal is an error.
Verified
- actionlint passes on both files.
- The guard was run locally against the live registry and a stubbed one. Each case gave the expected result:
| Case |
Result |
rc → latest, no stable yet |
moves |
v-prefixed version |
refused |
rc → rc |
moves |
rc → latest after a stable exists |
refused (skipped when called from release) |
| older stable |
refused |
| newer stable |
moves |
| a version not fully published |
nothing moved |
It needs the existing NPM_TOKEN secret, which already has write access to all nine packages.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
npm-dist-tag.yml points a dist-tag at a published version on @dbdiff/cli
and every platform package together. It runs by hand or from release.yml.
Until a stable release exists, latest follows each pre-release; after that
it only follows stable releases and never moves backwards.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.