include commit id in release commit and tag message

This commit is contained in:
Conduitry 2018-10-04 06:42:59 -04:00
parent ed2962c94f
commit ddeea2b933
1 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,9 @@ set -e
# go to root of repository
cd $(git rev-parse --show-toplevel)
# get commit id
COMMIT_ID="$(git rev-parse HEAD)"
# extract package name and version from package.json, remove devDependencies and scripts.prepare
ORIG_PKG="$(cat package.json)"
read NAME VERSION < <(node -e '
@ -29,8 +32,8 @@ git add -f $(tar tf ${NAME}-${VERSION}.tgz | cut -c 9-)
rm ${NAME}-${VERSION}.tgz
# commit and tag
git commit -m "Release v${VERSION}"
git tag v${VERSION} -a -m "v${VERSION}"
git commit -m "v${VERSION} @ ${COMMIT_ID}"
git tag v${VERSION} -a -m "v${VERSION} @ ${COMMIT_ID}"
# return to original state
git reset ${ORIG_BRANCH}