Skip to content

Commit

Permalink
Update release script to update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
plumdog committed Dec 22, 2017
1 parent 751c1c1 commit 3e5b15c
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ function error() {
}

function confirm() {
read -r -p "Are you sure? [Y/n] " response
msg="$1"
if [[ -z "$msg" ]]; then
msg="Are you sure?"
fi
read -r -p "$msg [Y/n] " response
case $response in
[yY][eE][sS]|[yY]|"")
return
Expand Down Expand Up @@ -110,7 +114,24 @@ function tag() {

sed -i "s/$current/$new/" setup.py

git add setup.py
underline="$(echo "$new" | sed 's/./-/g')"
log="$(git log "$(git describe --tags --abbrev=0)..." --pretty=format:'%s' --reverse | while read line; do echo "- $line"; done)"
changelog_entry="$new
$underline
$log
"
touch CHANGELOG.md
cat <(echo "$changelog_entry") CHANGELOG.md > CHANGELOG.md.new
mv CHANGELOG.md.new CHANGELOG.md
echo "CHANGES:"
echo "$log"
echo "/CHANGES"
confirm "Written changes to CHANGELOG.md, but not yet added. Edit there and then continue."
git add setup.py CHANGELOG.md
git commit -m "Bump to version $new"
git push origin master
git tag -a "v$new" -m "Version $new"
Expand Down

0 comments on commit 3e5b15c

Please sign in to comment.