File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
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
+ # Updated regex to allow one or more digits in each segment
17
+ tag_regex=' ^v[0-9]+\.[0-9]+\.[0-9]+$'
18
+ echo " $new_tag " | grep -E -q $tag_regex
19
+
20
+ if [[ $? -ne 0 ]]; then
21
+ echo -e " ${RED} ERROR${OFF} - Tag: $new_tag is not valid. Please use vX.X.X format."
22
+ exit 1
23
+ fi
24
+
25
+ git tag -a $new_tag -m " $new_tag Release"
26
+
27
+ echo -e " ${GREEN} OK${OFF} - Tagged: $new_tag "
28
+
29
+ git push --tags
30
+
31
+ echo -e " ${GREEN} OK${OFF} - Tags pushed to remote!"
32
+ echo -e " ${GREEN} DONE${OFF} "
You can’t perform that action at this time.
0 commit comments