Skip to content

Commit

Permalink
update pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
JosepFe committed Dec 10, 2024
1 parent 9fa3cd0 commit a93166a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
PATCH=$(echo $LATEST_VERSION | cut -d. -f3 | cut -d- -f1) # Removes preview suffix if present
# If the latest version has a preview label, extract the preview number
PREVIEW_SUFFIX=$(echo $LATEST_VERSION | grep -oP '(?<=-preview.)(\d+)' || echo "0")
PREVIEW_SUFFIX=$(echo $LATEST_VERSION | grep -oP '(?<=-preview\.)\d+' || echo "0")
# Increment version based on user input
if [ "$VERSION_TYPE" == "major" ]; then
Expand All @@ -75,7 +75,12 @@ jobs:
elif [ "$VERSION_TYPE" == "patch" ]; then
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
elif [ "$VERSION_TYPE" == "preview" ]; then
# Increment the preview number if there's a preview suffix
# If the patch version is 0 and the preview is selected, we need to start from patch 1
if [ "$PATCH" -eq "0" ]; then
PATCH=1
fi
# Increment the preview number
NEW_PREVIEW_SUFFIX=$((PREVIEW_SUFFIX + 1))
NEW_VERSION="$MAJOR.$MINOR.$PATCH-preview.$NEW_PREVIEW_SUFFIX"
fi
Expand Down

0 comments on commit a93166a

Please sign in to comment.