Skip to content

ci: align npm-publish.yml with node-red-standards 0.6.0 - #50

Merged
windkh merged 1 commit into
mainfrom
chore/tag-driven-publish
Aug 20, 2026
Merged

ci: align npm-publish.yml with node-red-standards 0.6.0#50
windkh merged 1 commit into
mainfrom
chore/tag-driven-publish

Conversation

@windkh

@windkh windkh commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Adopts npm-publish.yml from node-red-standards 0.6.0 (issue #2).

This repo is where the model came from. It has been tag-driven since before the standard existed, and reviewing it for the pin cleanup is what led to #2 — the standard adopted this repo's design rather than overwriting it. So there is no behaviour change here: git push --tags published before and publishes now. What changes are four details.

1. Pre-releases no longer reach latest — the important one

The workflow here ran a plain npm publish with no dist-tag handling at all. A tag like v0.3.0-beta.1 would therefore have moved the latest dist-tag onto a pre-release and pushed it to every install, including everyone on Manage Palette. latest cannot be walked back by publishing, only by a separate dist-tag change.

Now a semver pre-release (anything after a -) publishes to beta and marks the GitHub release as a pre-release.

2. The publish job moves from Node 20 to 22.x

This repo depends on node-red ^5.0.1, and node-red@5 requires Node >=22.9. Pinning 20 for the publish job was inconsistent with its own dependency floor — an EBADENGINE warning today rather than a failure, but pointed the wrong way. The template pin exists for exactly this case: it must satisfy the strictest engines.node among consuming repos, not the standard's own >=20 baseline.

3. New: the tag must agree with package.json

npm publishes the manifest version, not the tag name — so git tag v0.2.13 on a commit that still says 0.2.12 publishes 0.2.12 under a tag that lies about it, and burns 0.2.13 for good, since a version cannot be published twice. verify compares the two and fails before anything reaches the registry.

4. gh release create instead of softprops/action-gh-release

gh is preinstalled on the runners. A workflow that ships into every repo and holds an npm publish token is worth a few lines of shell to keep its action list to the official ones. The step is also idempotent now — the publish before it cannot be repeated, so a re-run must not fail on a release that already exists.

The job names change (testverify) and the gate now runs the same matrix as CI, which it already did here.

This repo is where the tag-driven model came from -- reviewing it during the pin
cleanup is what led to node-red-standards issue #2, and the standard adopted this
design rather than overwriting it. So no behaviour change: `git push --tags`
published before and publishes now. Four details change.

1. Pre-releases no longer reach `latest`. The workflow ran a plain `npm publish`
   with no dist-tag handling, so a tag like v0.3.0-beta.1 would have moved the
   `latest` dist-tag onto a pre-release and pushed it to every install, Manage
   Palette included. `latest` cannot be walked back by publishing, only by a
   separate dist-tag change. A semver pre-release now goes to `beta` and the
   GitHub release is marked accordingly.

2. The publish job moves from Node 20 to 22.x. This repo depends on
   node-red ^5.0.1 and node-red@5 requires >=22.9, so a 20 pin pointed the wrong
   way against its own dependency floor.

3. verify fails when the tag disagrees with package.json. npm publishes the
   manifest version, not the tag name, so a mismatch publishes the wrong number
   under a tag that lies about it and burns the intended one for good.

4. `gh release create` replaces softprops/action-gh-release. gh is preinstalled
   on the runners, and a workflow holding an npm publish token is worth a few
   lines of shell to keep its action list official. The step is idempotent now --
   the publish before it cannot be repeated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@windkh
windkh merged commit bc3c4a6 into main Aug 20, 2026
3 checks passed
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.

1 participant