diff --git a/release.sh b/release.sh index 52c6fd1..66dd166 100755 --- a/release.sh +++ b/release.sh @@ -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"