Skip to content

Commit

Permalink
Ci/CD fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dodoooh committed Dec 10, 2024
1 parent a70cb45 commit d98d06f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,21 @@ jobs:
run: |
git fetch --tags
# Überprüfen, ob ein Tag existiert
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0")
# Falls keine Tags existieren, starte mit 1.0.0
if [[ "$VERSION" == "0.0.0" ]]; then
NEW_VERSION="1.0.0"
else
NEW_VERSION=$(echo $VERSION | awk -F. -v OFS=. '{$NF++; print}')
# Aktuellsten Tag ermitteln
VERSION=$(git describe --tags --abbrev=0)
# Neue Version basierend auf dem aktuellen Tag erstellen
NEW_VERSION=$(echo $VERSION | awk -F. -v OFS=. '{$NF++; print}')
# Überprüfen, ob der neue Tag bereits existiert
if git rev-parse "refs/tags/$NEW_VERSION" >/dev/null 2>&1; then
echo "Tag $NEW_VERSION already exists. Skipping tag creation."
exit 0
fi
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
# Neuen Tag erstellen und pushen.
# Neuen Tag erstellen und pushen
git tag -a $NEW_VERSION -m "Release $NEW_VERSION"
git push origin $NEW_VERSION
Expand Down

0 comments on commit d98d06f

Please sign in to comment.