Skip to content

Commit 2754d10

Browse files
authored
fix: #dev-deploy tag name fix 2
1 parent 0128721 commit 2754d10

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/dev.kodemy.deploy.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,24 @@ jobs:
207207
208208
git tag -l | xargs git tag -d
209209
git fetch --tags
210-
211210
tags=$(git tag -l)
212-
latest_tag=$(echo "$tags" | grep -E '^0\.0\.[0-9]+$' | sort -V | tail -n 1)
211+
212+
latest_tag=$(echo "$tags" | grep -E '^v?0\.[0-9]+\.[0-9]+(-.*)?$' | sort -V | tail -n 1)
213213
214214
if [ -n "$latest_tag" ]; then
215-
version_number=$(echo "$latest_tag" | sed 's/^0\.0\.//')
216-
new_version=$((version_number + 1))
217-
new_tag="0.0.$new_version"
215+
if [[ "$latest_tag" == v* ]]; then
216+
latest_tag="${latest_tag#v}"
217+
fi
218+
219+
base_version=$(echo "$latest_tag" | sed 's/-.*//')
220+
221+
major=$(echo "$base_version" | cut -d'.' -f1)
222+
minor=$(echo "$base_version" | cut -d'.' -f2)
223+
patch=$(echo "$base_version" | cut -d'.' -f3)
224+
225+
new_patch=$((patch + 1))
226+
227+
new_tag="${major}.${minor}.${new_patch}"
218228
else
219229
new_tag="0.0.1"
220230
fi

0 commit comments

Comments
 (0)