From ff1f0eaafd0dbcd4c063c3c557d9cee0a461f89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 11 Aug 2025 18:40:09 +0200 Subject: [PATCH] Release: Run `npm publish` in the post-release phase PR gh-5681 specified the `tmp/release/dist` folder as `publishPath` so that `npm publish` is done from the dist repo, not the source one. However, `npm publish` is invoked by release-it before the post-release phase, at which stage the dist repo is not updated with the new release yet. Instead, do the `npm publish` manually in the post-release stage, just after the dist repo is updated & changes are pushed. Closes gh-5690 --- .release-it.cjs | 7 +++++-- build/release/post-release.sh | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.release-it.cjs b/.release-it.cjs index 425e9d313..42eb979b0 100644 --- a/.release-it.cjs +++ b/.release-it.cjs @@ -34,7 +34,10 @@ module.exports = { tokenRef: "JQUERY_GITHUB_TOKEN" }, npm: { - publish: true, - publishPath: "tmp/release/dist" + + // We're publishing from a dist folder generated in the post-release + // step, so we also need to publish by ourselves; release-it would + // do it too early. + publish: false } }; diff --git a/build/release/post-release.sh b/build/release/post-release.sh index 271c00734..d20949e3c 100644 --- a/build/release/post-release.sh +++ b/build/release/post-release.sh @@ -38,8 +38,9 @@ git commit -m "Release: $1" git tag -s $1 -m "Release: $1" # Wait for confirmation from user to push changes to dist repo -read -p "Press enter to push changes to dist repo" +read -p "Press enter to push changes to dist repo & publish to npm" git push --follow-tags +npm publish cd - # Restore AUTHORS URL