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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user