From d7e5bcea1b31d169c0c05aacbae2a02092b9d751 Mon Sep 17 00:00:00 2001 From: Zykino Date: Sun, 18 Sep 2022 20:46:03 +0200 Subject: [PATCH] Add a script to have consistents tags --- scripts/git-tag.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 scripts/git-tag.sh diff --git a/scripts/git-tag.sh b/scripts/git-tag.sh new file mode 100755 index 0000000..ceff317 --- /dev/null +++ b/scripts/git-tag.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +CURRENT_VERSION=$(grep -E "^version\s?=" Cargo.toml | cut --delimiter='"' --fields=2) +TAG="v$CURRENT_VERSION" + +if cargo publish --dry-run; then + echo "Creating tag: $TAG" + echo "Do not forget to push it: git push origin $TAG" + + git tag -a "$TAG" -m "Version $CURRENT_VERSION" +else + exit $? +fi