From 7b18e983c94302b96496f3f4f112c48632bcf993 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Mon, 12 Feb 2024 21:40:51 +0000 Subject: [PATCH] chore: faster tag and release procedure --- justfile | 3 +++ scripts/try-tag-and-release.sh | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 scripts/try-tag-and-release.sh 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