From de394154131ca7da862926a9115d40dae2d25461 Mon Sep 17 00:00:00 2001 From: kingchenc Date: Thu, 21 May 2026 21:43:57 +0200 Subject: [PATCH] ci(release): drop prepublishOnly hook + ignore-scripts on main publish The root cause of the previous failure was the package.json "prepublishOnly": "napi prepublish -t npm" script. When the workflow ran `npm publish` for the main wickra package it implicitly invoked that hook, which re-attempted to publish every platform subpackage and hit 403 "cannot publish over 0.1.2" because they were already on the registry. The error trail looked like it came from the main publish step but the failing command was actually the hook. Two-part fix: - Remove prepublishOnly entirely from bindings/node/package.json. The release workflow already does the per-platform publish itself, in a loop, idempotently. - Belt-and-braces: pass --ignore-scripts when publishing the main package so any prepublish-hook drift in the future is suppressed. --- .github/workflows/release.yml | 7 +++++-- bindings/node/package.json | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22dcfb51..5dd4e76b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -244,12 +244,15 @@ jobs: echo "::notice::skip wickra@$version (already on npm)" exit 0 fi - npm publish --access public + # --ignore-scripts so any leftover prepublish hooks (which would + # otherwise try to republish the already-published platform + # subpackages) can't sabotage the main publish. + npm publish --access public --ignore-scripts rc=$? if [ "$rc" -ne 0 ]; then echo "::warning::first attempt failed (rc=$rc); retrying after 30s" sleep 30 - npm publish --access public + npm publish --access public --ignore-scripts rc=$? fi exit $rc diff --git a/bindings/node/package.json b/bindings/node/package.json index 82edecdc..7d2f10f2 100644 --- a/bindings/node/package.json +++ b/bindings/node/package.json @@ -54,7 +54,6 @@ "build": "napi build --platform --release", "build:debug": "napi build --platform", "artifacts": "napi artifacts", - "prepublishOnly": "napi prepublish -t npm", "universal": "napi universal", "version": "napi version", "test": "node --test __tests__/"