#!/bin/bash
# Commit changes, tag and push release to GitHub.
cd "$(dirname "$0")/.." || exit 1
VERSION="$(python3 -c "import gaupol; print(gaupol.__version__)")"
echo "Git status:"
git status --porcelain
printf "\nRelease version: $VERSION\n"
read -p "Press Enter to continue or Ctrl+C to abort: "
git commit -a -m "RELEASE $VERSION"
git tag -s -m "RELEASE $VERSION" $VERSION
git push
git push --tags
echo ""
echo "Add release notes and possible downloads:"
echo "https://github.com/otsaloma/gaupol/tags"
echo ""
egrep -B 999 -m2 "==+" NEWS.md
