WebTools-NG/script/release.sh

29 lines
776 B
Bash
Raw Normal View History

2022-01-01 21:15:20 +00:00
# Release from master into a draft release
# Get current branch
CURBRANCH=$(git rev-parse --abbrev-ref HEAD)
echo $CURBRANCH
# Checkout Master Branch
git checkout master
# Make sure Master Branch locally is updated
git pull
# Checkout Release Branch
git checkout release
# Update Release Branch from Master
git merge master
# Get current version
CURVER=$(cat package.json|grep -oP '(?<="version": ")[^"]*')
echo $CURVER
2022-01-01 21:40:10 +00:00
# Get git root directory
root=$(git rev-parse --show-toplevel 2>&1)
# get commit hash for version file
2022-01-01 21:54:23 +00:00
rev=$(git rev-parse --short HEAD 2>&1)
2022-01-01 21:52:38 +00:00
echo Committing v$CURVER.$rev
2022-01-01 21:15:20 +00:00
# Commit to Release Branch
2022-01-01 21:41:41 +00:00
git commit -am v$CURVER.$rev
2022-01-01 21:15:20 +00:00
# Tag Release Branch
2022-01-01 21:41:41 +00:00
git tag v$CURVER.$rev
2022-01-01 21:15:20 +00:00
# Upload and trigger a release
git push && git push --tags
2022-01-01 21:52:38 +00:00
git checkout $CURBRANCH