.github/gitflow-hooks/pre-flow-release-finish
#!/bin/bash
#
# Runs at the end of git flow release start
#
# Positional arguments:
# $1 The version (including the version prefix)
# $2 The origin remote
# $3 The full branch name (including the release prefix)
# $4 The base from which this release is started
#
# The following variables are available as they are exported by git-flow:
#
# MASTER_BRANCH - The branch defined as Master
# DEVELOP_BRANCH - The branch defined as Develop
#
# VERSION=$1
# ORIGIN=$2
# BRANCH=$3
# BASE=$4
ROOT=`git rev-parse --show-toplevel`
VERSION=${1:1}
sed -i "s/__version__ = '[0-9\.a]\+'/__version__ = '$VERSION'/g" "$ROOT/arknights_mower/__init__.py"
git add "$ROOT/arknights_mower/__init__.py"
git commit -m "release: v$VERSION"