release.sh: keep tags updated

pull/71/head^2
Jake McGinty 2021-05-09 21:17:23 +09:00
parent b4076261a4
commit 9d69515d19
1 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,7 @@ die () {
exit 1
}
for command in help2man cargo-release; do
for command in help2man cargo-release sed; do
if ! command -v $command &> /dev/null
then
echo "$command binary could not be found"
@ -17,6 +17,8 @@ done
[ "$#" -eq 1 ] || die "usage: ./release.sh [patch|major|minor|rc]"
git diff --quiet || die 'ERROR: git repo is dirty.'
OLD_VERSION="v$(cargo pkgid -p shared | cut -d '#' -f 2)"
cargo release "$1" --no-confirm --exclude "hostsfile" --exclude "publicip"
# re-stage the manpage commit and the cargo-release commit
@ -30,8 +32,9 @@ for binary in "innernet" "innernet-server"; do
done
git add doc
perl -pi -e "s/$OLD_VERSION/$VERSION/g" README.md
VERSION="$(cargo pkgid -p shared | cut -d '#' -f 2)"
VERSION="v$(cargo pkgid -p shared | cut -d '#' -f 2)"
git commit -m "meta: release v$VERSION"
git tag -a "v$VERSION" -m "release v$VERSION"
git commit -m "meta: release $VERSION"
git tag -a "$VERSION" -m "release $VERSION"