Skip to content

Commit

Permalink
Fixed the CI tagging (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikkumar-mohite authored Aug 31, 2024
1 parent a877c5b commit 35bbd02
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Configure Git
run: |
git config user.name "Pratikkumar Mohite"
git config user.email "mohite770.pm@gmail.com"
- name: debug
run: |
git --version
- name: Update the latest tag
id: update_latest_tag
run: |
echo "Last tag: latest_tag=\"$(git tag | head -n 1)\""
latest_tag="$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)"
git fetch --tags
latest_tag="$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)"
if [ -z "$latest_tag" ]; then
latest_tag="0.0.1"
fi
IFS='.' read -ra version_parts <<< "$latest_tag"
major=${version_parts[0]}
minor=${version_parts[1]}
patch=${version_parts[2]}
new_patch=$((patch + 1))
new_tag="$major.$minor.$new_patch"
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
latest_tag="v0.0.1"
echo "new_tag=$latest_tag" >> $GITHUB_OUTPUT
else
echo $latest_tag
IFS='.' read -ra version_parts <<< "$latest_tag"
major=${version_parts[0]}
minor=${version_parts[1]}
patch=${version_parts[2]}
new_patch=$((patch + 1))
new_tag="$major.$minor.$new_patch"
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
fi
- name: Create and push new tag
run: |
Expand Down

0 comments on commit 35bbd02

Please sign in to comment.