From 82c3ffefe3fa7834d9c213ea1605ee55f24480e6 Mon Sep 17 00:00:00 2001 From: Travis Kaufman Date: Tue, 7 Feb 2017 10:50:37 -0500 Subject: [PATCH] fix(scripts): Generate semver tag within post-release.sh (#263) This commit modifies post-release.sh to auto-generate a semver tag based on the highest tagged version of material-components-web by lerna. E.g., 'material-components-web@0.4.0' would be translated into a `v0.4.0` repo tag. This mainly addresses the issue where standard-changelog fails to generate a correct changelog due to lack of semver tags. However, having an auto-generated semver tag for the _entire_ repo seems useful both for automated tools relying on semver, and also for non-automated humans looking to get a general worldview of our latest release :) Fixes #209 [ci skip] --- scripts/post-release.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/post-release.sh b/scripts/post-release.sh index 32d27bf9549..03ffe7ffcdd 100755 --- a/scripts/post-release.sh +++ b/scripts/post-release.sh @@ -28,4 +28,11 @@ git add CHANGELOG.md git commit -m "docs: Update CHANGELOG.md" echo "" -log "Done! You should now git push to master" +# Extract repo version from material-components-web@Maj.min.patch tag generated by lerna +REPO_VERSION=$($(npm bin)/semver $(git tag -l | grep material-components-web | sed 's/material-components-web@//') | tail -n 1) +SEMVER_TAG="v$REPO_VERSION" +log "Tagging repo using semver tag $SEMVER_TAG" +git tag $SEMVER_TAG -m "Material Components for the web release $SEMVER_TAG" +echo "" + +log "Done! You should now git push to master and git push --tags"