Skip to content

Commit e3bd06b

Browse files
committed
trying to fix the version number thing again
1 parent ed8f1da commit e3bd06b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/docker-publish.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ jobs:
2626
- name: Get latest tag and bump version
2727
id: versioning
2828
run: |
29-
latest_tag=$(git tag --sort=-v:refname | head -n 1)
29+
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
3030
echo "Latest tag: $latest_tag"
3131
32-
if [[ "$latest_tag" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
33-
major=${BASH_REMATCH[1]}
34-
minor=${BASH_REMATCH[2]}
35-
patch=${BASH_REMATCH[3]}
36-
new_tag="v${major}.$((minor)).$((patch+1))"
37-
else
38-
new_tag="v0.1.0"
39-
fi
32+
IFS='.' read -r major minor patch <<< "${latest_tag#v}"
33+
34+
patch=$((patch + 1))
35+
new_tag="v${major}.${minor}.${patch}"
4036
4137
echo "New tag: $new_tag"
4238
echo "NEW_TAG=$new_tag" >> $GITHUB_ENV

0 commit comments

Comments
 (0)