diff --git a/justfile b/justfile index 9fe9666a..2758735d 100644 --- a/justfile +++ b/justfile @@ -14,3 +14,6 @@ minor: major: cargo release version major --execute + +release: + scripts/try-tag-and-release.sh diff --git a/scripts/try-tag-and-release.sh b/scripts/try-tag-and-release.sh new file mode 100755 index 00000000..54c7adc8 --- /dev/null +++ b/scripts/try-tag-and-release.sh @@ -0,0 +1,14 @@ +#!/bin/bash +date=$(date +'%Y%m%d') +incr=1 + +while [ $(git tag -l "$date-$incr") ]; do + incr=$((incr+1)) +done + +tag=$date-$incr +echo About to tag and push $tag in 3 seconds... +sleep 3s + +git tag $tag +git push --atomic origin $(git rev-parse --abbrev-ref HEAD) $tag