Skip to content

Commit 5b3b254

Browse files
committed
add release helper script
1 parent 9c2f71c commit 5b3b254

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

script/release

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Usage:
4+
# script/release
5+
6+
# COLORS
7+
OFF='\033[0m'
8+
RED='\033[0;31m'
9+
GREEN='\033[0;32m'
10+
BLUE='\033[0;34m'
11+
12+
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
13+
echo -e "The latest release tag is: ${BLUE}${latest_tag}${OFF}"
14+
read -p 'New Release Tag (vX.X.X format): ' new_tag
15+
16+
tag_regex='^v\d\.\d\.\d$'
17+
echo "$new_tag" | grep -P -q $tag_regex
18+
19+
if [[ $? -ne 0 ]]; then
20+
echo "Tag: $new_tag is valid"
21+
fi
22+
23+
git tag -a $new_tag -m "$new_tag Release"
24+
25+
echo -e "${GREEN}OK${OFF} - Tagged: $new_tag"
26+
27+
git push --tags
28+
29+
echo -e "${GREEN}OK${OFF} - Tags pushed to remote!"
30+
echo -e "${GREEN}DONE${OFF}"

0 commit comments

Comments
 (0)