Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoNatan committed Dec 7, 2017
1 parent 0c3a88d commit 702434f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions releaseVersion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
set -e

if [ "$#" -ne 1 ]; then
echo >&2 "Illegal number of parameters"
echo >&2 "releaseVersion.sh <version>"
exit -1
fi

if [[ -n $(git status --porcelain) ]]; then
echo >&2 "Cannot release version because there are unstaged changes:"
git status --short
exit -2
fi

if [[ -n $(git tag --contains $(git rev-parse --verify HEAD)) ]]; then
echo >&2 "The latest commit is already contained in the following releases:"
git tag --contains $(git rev-parse --verify HEAD)
exit -3
fi

if [[ -n $(git log --branches --not --remotes) ]]; then
echo "Pushing commits to git"
git push
fi

echo "Updating CHANGELOG"

github_changelog_generator --future-release "$1" --no-verbose

git add -A
git commit -m "$1"
git tag "$1"

git push
git push --tags

0 comments on commit 702434f

Please sign in to comment.