-
Notifications
You must be signed in to change notification settings - Fork 116
/
release.sh
executable file
·33 lines (27 loc) · 853 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
LAST_TAG=`git describe --tags --match 'v*' --abbrev=0`
git pull || exit
if [ -n "$1" ]; then
TAG="$1"
if [ -z "`grep -E '^## [0-9\.]* '"$TAG"'$' CHANGELOG.md`" ]; then
echo "Please update CHANGELOG.md:"
echo "##" `date +'%d.%m.%Y'` "$TAG"
echo "New features:"
echo "Improvements:"
echo "Fixes:"
../../utils/git-log-since-tag.sh $LAST_TAG | awk '{print "* " $0}'
exit 1
fi
awk '/^## [0-9.]* v[0-9.]*$/ { first++ } { if (first == 1) {print }}' README.md
read -p "Commit and release? (y/N) " ANSWER
if [ "$ANSWER" != "y" ]; then
exit 2
fi
echo "Releasing $TAG"
git add CHANGELOG.md &&
git commit -m "dist" && git tag "$TAG" &&
git push && git push --tags &&
git checkout master && git merge develop && git push && git checkout develop # merge with master
else
echo "Last released version was $LAST_TAG"
fi