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
This commit is contained in:
Michał Gołębiowski-Owczarek 2025-08-11 18:40:09 +02:00 committed by GitHub
parent fb5ab0f546
commit ff1f0eaafd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -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
}
};

View File

@ -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