From 9f7868594b0c5791977a238e7b0751aa1f6e71e6 Mon Sep 17 00:00:00 2001 From: Kai Mallea Date: Fri, 16 Jul 2021 12:22:19 -0400 Subject: [PATCH 1/2] ci(lerna): fix lerna publish --- release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sh b/release.sh index bc67ff8b..18835b71 100755 --- a/release.sh +++ b/release.sh @@ -15,7 +15,7 @@ then echo "spotify/web-scripts: Configuring npm for publishing..." echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc echo "spotify/web-scripts: Attempting publish..." - npx lerna publish --yes --conventional-commits --create-release=github --registry=https://registry.npmjs.org + npx lerna publish --yes --force-publish --conventional-commits --create-release=github --registry=https://registry.npmjs.org exit $? else echo "spotify/web-scripts: No release will be triggered." >&2 From 8ebf914440335d9488588dad61de66f6c9f47c1e Mon Sep 17 00:00:00 2001 From: Kai Mallea Date: Fri, 16 Jul 2021 13:30:23 -0400 Subject: [PATCH 2/2] docs(release.sh): add explanation to release script --- release.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release.sh b/release.sh index 18835b71..a35bc9bf 100755 --- a/release.sh +++ b/release.sh @@ -1,3 +1,10 @@ +# This release script determines if a publish should happen using a dry run of semantic release to determine if the +# commits contain publishable changes (feat, bug, breaking change). If so, lerna will be used to perform the actual +# publish, however, lerna also has its own logic for determining whether to publish. Specifically, it will run git diff +# in each package, excluding markdown files, tests, etc. So any attempt to force a version bump with an empty commit or +# readme tweak will fail. To get around this, we pass the `force-publish` option to lerna, skipping the git diff for +# changed packages. This allows the semantic release dry run check to be the deciding factor for publishing. + # this message is logged by semantic-release when one of the commits found by web-scripts should trigger a release expected_release_message="The release type for the commit is"