From c24c638bc86cab98793ace6b5488de25ca242c85 Mon Sep 17 00:00:00 2001 From: Matt Fellows <53900+mefellows@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:43:57 +1100 Subject: [PATCH] fix: prevent node-gyp rebuild on fresh install Issue discovered here: https://www.linen.dev/s/pact-foundation/t/16633868/hell-all-quick-question-in-the-migration-guide-for-v12-it-s-#100081d7-2fee-4420-8eac-d55858dcc483 See also https://github.com/npm/cli/issues/5234#issuecomment-1291139150 --- script/ci/lib/publish.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/ci/lib/publish.sh b/script/ci/lib/publish.sh index 28a3b687..0020219a 100755 --- a/script/ci/lib/publish.sh +++ b/script/ci/lib/publish.sh @@ -15,9 +15,11 @@ echo " Publishing pact-core@${VERSION}..." if [[ ${DRY_RUN:-} == 'true' ]]; then echo "publishing in dry run mode" npm publish --access-public --dry-run - else + else echo "--> Preparing npmrc file" "$SCRIPT_DIR"/create_npmrc_file.sh + echo "--> Removing binding.gyp to prevent rebuild. See https://github.com/npm/cli/issues/5234#issuecomment-1291139150" + rm "${SCRIPT_DIR}/../../../binding.gyp" npm publish --access public --tag latest fi echo " done!"