From e2f1d8ec408123419a12e433f9cf17a1e33a8464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ey=C3=BE=C3=B3r=20Magn=C3=BAsson?= Date: Mon, 17 Sep 2018 08:38:46 -0400 Subject: [PATCH] fix(publish script): ensure changelog is properly generated --- bin/publish | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/publish b/bin/publish index ad948633e3..a58f556d96 100755 --- a/bin/publish +++ b/bin/publish @@ -9,11 +9,19 @@ cd ${garden_root} lerna version --no-push git reset HEAD~1 -./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md --commit-path . -s -git add CHANGELOG.md +# Note: conventional-changelog reads the current version from package.json and finds previous versions +# by searching for the string "tag:" within commit messages. It should therefore run after the +# version is updated in package.json but before the change is commited and tagged. + +./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md --commit-path . -s --pkg ./garden-cli +git add . version=$(node -p "require('./lerna.json').version") git commit -m "chore(release): release ${version}" +# We need to re-create the tag created by lerna since adding the changelog changes the commit hash +git tag -d v${version} +git tag -a v${version} -m "v${version}" + git push --tags --no-verify git push origin HEAD --no-verify