Skip to content

fix(release): unblock v0.1.0 npm publish — handle component-prefixed tag + Node 24 opt-in#23

Merged
IgorShevchik merged 1 commit into
mainfrom
fix/release-tag-prefix-and-node24
May 29, 2026
Merged

fix(release): unblock v0.1.0 npm publish — handle component-prefixed tag + Node 24 opt-in#23
IgorShevchik merged 1 commit into
mainfrom
fix/release-tag-prefix-and-node24

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Unblocks the v0.1.0 publish to npm. Three small interrelated fixes — all touch the release pipeline; no src/ changes.

The story

PR #20 (release v0.1.0) merged → release-please.yml ran → tag b24rabbitmq-v0.1.0 and GitHub Release "b24rabbitmq: v0.1.0" created → npm-publish.yml triggered on release: publishedpublish failed at the sanity check because the tag carries a component prefix the strip logic didn't handle. As a bonus, that same workflow run surfaced a Node.js 20 deprecation warning on googleapis/release-please-action@v4 — and the same warning applies to every JavaScript action we pin in the other workflows.

Fix #1 — npm-publish sanity check handles both tag formats

-RAW="${GITHUB_REF#refs/tags/}"
-TAG="${RAW#v}"
+strip_tag() {
+  local raw="$1"
+  raw="${raw#b24rabbitmq-}"
+  raw="${raw#v}"
+  echo "$raw"
+}
+RAW="${GITHUB_REF#refs/tags/}"
+TAG=$(strip_tag "$RAW")

Same helper used on both the release-event path and the workflow_dispatch fallback. Dry-tested locally for b24rabbitmq-v0.1.0 (legacy), v0.1.1 (future), 0.1.0, b24rabbitmq-0.1.0 — all normalise to the bare semver 0.1.0 / 0.1.1.

Fix #2 — release-please stops adding the component prefix

   "release-type": "node",
   "include-v-in-tag": true,
+  "include-component-in-tag": false,
   "bump-minor-pre-major": true,

Single-package repo; the component prefix only adds noise. Future release PRs propose tag v0.1.1 (clean). The strip helper still works for both formats, so this PR doesn't have to land before v0.1.0 ships — but it's the right long-term shape.

Fix #3 — Node 24 opt-in across all three workflows

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

Added at the workflow level to release-please.yml, npm-publish.yml, and ci.yml. JavaScript actions (googleapis/release-please-action@v4, actions/checkout@v4, actions/setup-node@v4, pnpm/action-setup@v4) still run on Node 20 internally; the runner deprecation notice mandates Node 24 from 2026-06-02 and removes Node 20 from runners 2026-09-16. The FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 flag is the documented forward-compat option — opts the whole workflow into Node 24 without touching any individual action pin. Removable once every action ships a Node 24 native release.

Post-merge plan (to actually get v0.1.0 onto npm)

  1. Merge this PR.
  2. Trigger npm-publish.yml via workflow_dispatch on mainHEAD on main is the tagged commit b24rabbitmq-v0.1.0, git describe --tags --exact-match HEAD returns that tag, strip helper normalises to 0.1.0, matches package.json, OIDC publish proceeds.
  3. Verify https://www.npmjs.com/package/@bitrix24/b24rabbitmq shows 0.1.0 with a green provenance badge.

After this is in npm, the next release will be the first one running through the corrected pipeline end-to-end — clean tag, no manual dispatch.

Gates

Gate Result
pnpm lint green
pnpm typecheck green
pnpm test 66/66
pnpm test:coverage 100/100/100/100
pnpm build green
pnpm docs:build green
Tag-strip dry-run (4 inputs) all normalise to bare semver

Behavioural change

None in src/. Public exports unchanged. No bundle size delta.


Generated by Claude Code

…de 24 opt-in (all workflows)

Three small fixes bundled — all touch the release pipeline.

1. Tag mismatch in npm-publish (real blocker for v0.1 on npm):

release-please created tag `b24rabbitmq-v0.1.0` (manifest-mode
default — component prefix derived from package-name). The
sanity check in npm-publish.yml stripped only `refs/tags/`
+ `v`, leaving `b24rabbitmq-v0.1.0` vs `0.1.0` in package.json
-> mismatch -> publish fails with `::error::Tag b24rabbitmq-...
does not match`. The release-please workflow run on PR #20's
merge surfaced the publish failure.

Fix: extract a `strip_tag()` shell helper that strips both
`b24rabbitmq-` (legacy) and `v` (current convention). Same
helper used on both the release-event path and the workflow_
dispatch fallback. Dry-tested locally for `b24rabbitmq-v0.1.0`,
`v0.1.1`, `0.1.0`, and `b24rabbitmq-0.1.0` — all normalise to
the bare semver.

2. Future tags should be plain `vX.Y.Z`:

`include-component-in-tag: false` added to release-please-
config.json. Single-package repo, the component prefix only
added noise. Once this lands, the next release-please PR
proposes tag `v0.1.1` (not `b24rabbitmq-v0.1.1`), and the
shell strip helper still works for both formats.

3. Node 20 deprecation warning (all three workflows):

Workflow run https://github.com/bitrix24/b24rabbitmq/actions/runs/26621102915
surfaced the GitHub Actions runner deprecation notice for
Node.js 20 (mandatory Node 24 from 2026-06-02, removal
2026-09-16). googleapis/release-please-action@v4 was the one
named in that run, but actions/checkout@v4, actions/setup-node@v4,
and pnpm/action-setup@v4 are all JavaScript actions in the
same bucket and surface the same warning across our other
workflows.

Fix: add `env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'` at
the workflow level to all three workflows that run JS actions
(release-please.yml, npm-publish.yml, ci.yml). Documented forward-
compat flag from the runner deprecation notice. Single env var,
no other behavioural change, removable once every action we
pin has shipped a Node 24 native release.

Post-merge plan:
- Re-trigger npm-publish.yml via workflow_dispatch on main
  (HEAD on main is the tagged commit `b24rabbitmq-v0.1.0`).
- The strip helper accepts that tag -> 0.1.0 -> matches
  package.json -> OIDC publish proceeds.
- After @bitrix24/b24rabbitmq@0.1.0 lands on npm, future
  releases will have plain `vX.Y.Z` tags and no manual
  workflow_dispatch will be needed.

Gates: lint, typecheck, test (66/66), build, docs:build all
green. No src/ changes.
@IgorShevchik IgorShevchik merged commit f24e8f2 into main May 29, 2026
8 checks passed
IgorShevchik added a commit that referenced this pull request May 29, 2026
…ager wins (#25)

The first workflow_dispatch run of npm-publish.yml on v0.1.0
(https://github.com/bitrix24/b24rabbitmq/actions/runs/26621673812)
failed at Install pnpm:

  Error: Multiple versions of pnpm specified:
    - version 10 in the GitHub Action config with the key "version"
    - version pnpm@10.10.0 in the package.json with the key
      "packageManager"
  Remove one of these versions to avoid version mismatch errors
  like ERR_PNPM_BAD_PM_VERSION

The explicit `version: 10` on pnpm/action-setup@v4 was added in
PR #18 on a senior-dev review nit. On the action version current
at runtime, two sources of truth is no longer accepted.

Drop the workflow version: input. Let pnpm/action-setup@v4 read
packageManager: pnpm@10.10.0 from package.json directly. Same
pattern already used in ci.yml.

Bonus: the same failed run also logs:
  "Node.js 20 is deprecated. The following actions target Node.js
  20 but are being forced to run on Node.js 24: actions/checkout@v4,
  pnpm/action-setup@v4."
That's exactly the intended behaviour of the
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true flag added in PR #23 —
informational, not an error.

Post-merge: re-trigger npm-publish.yml via workflow_dispatch on
main.

Gates: lint, typecheck, test (66/66), build, docs:build, ci
aggregator — all 8 green on PR #25. No src/ changes.
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.

Docs i18n: translate EN → RU via an AI agent skill (replace the removed script) Reanimation follow-ups: community, CI hardening & onboarding

2 participants