File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,22 +7,19 @@ cd /home/vito/vito
77echo " Pulling changes..."
88git fetch --all
99
10- # Parse release type argument
11- INCLUDE_PRE_RELEASES=" "
10+ INCLUDE_PATTERN=' ^3\.[0-9]+\.[0-9]+$' # stable only
1211
1312if [[ " $1 " == " --alpha" ]]; then
14- INCLUDE_PRE_RELEASES= " alpha| beta|rc "
13+ INCLUDE_PATTERN= ' ^3\.[0-9]+\.[0-9]+(- alpha-[0-9]+|- beta-[0-9]+|-rc-[0-9]+)?$ '
1514elif [[ " $1 " == " --beta" ]]; then
16- INCLUDE_PRE_RELEASES= " beta|rc "
15+ INCLUDE_PATTERN= ' ^3\.[0-9]+\.[0-9]+(- beta-[0-9]+|-rc-[0-9]+)?$ '
1716fi
1817
19- echo " Checking out the latest tag..."
18+ # Filter and sort matching tags
19+ MATCHING_TAGS=$( git tag | grep -E " $INCLUDE_PATTERN " | sort -V)
2020
21- if [[ -n " $INCLUDE_PRE_RELEASES " ]]; then
22- NEW_RELEASE=$( git tag -l " 3.*" | grep -E " $INCLUDE_PRE_RELEASES |^[0-9]+\.[0-9]+\.[0-9]+$" | sort -Vr | head -n 1)
23- else
24- NEW_RELEASE=$( git tag -l " 3.*" | grep -E ' ^[0-9]+\.[0-9]+\.[0-9]+$' | sort -Vr | head -n 1)
25- fi
21+ # Get the latest tag from the list
22+ NEW_RELEASE=$( echo " $MATCHING_TAGS " | tail -n 1)
2623
2724if [[ -z " $NEW_RELEASE " ]]; then
2825 echo " ❌ No matching tag found."
You can’t perform that action at this time.
0 commit comments