Skip to content

Commit

Permalink
fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
caioricciuti committed Jun 13, 2024
1 parent cdec748 commit 09fc4dc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@ jobs:
- name: Determine version strategy
id: determine_version
run: |
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Latest tag: $latest_tag"
if [ -z "$latest_tag" ]; then
# Check if there are any tags
tag_count=$(git tag -l | wc -l)
if [ "$tag_count" -eq 0 ]; then
# No tags, start with initial version
major=0
minor=1
patch=0
new_tag="v$major.$minor.$patch"
else
# Tags exist, use existing strategy
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Latest tag: $latest_tag"
IFS='.' read -r -a parts <<< "${latest_tag//v/}"
major=${parts[0]}
minor=${parts[1]}
patch=${parts[2]}
# Increment the patch version
new_patch=$((patch + 1))
major=${major:-0}
minor=${minor:-0}
patch=${patch:-0}
new_tag="v$major.$minor.$new_patch"
fi
new_tag="v$major.$minor.$new_patch"
echo "New tag: $new_tag"
echo "new_tag=$new_tag" >> $GITHUB_ENV
Expand Down

0 comments on commit 09fc4dc

Please sign in to comment.