Skip to content

Commit

Permalink
Bump minor version and reset patch in Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
bensadeh committed Aug 17, 2024
1 parent 62dcdea commit 48f608f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ jobs:
# Switch to the branch that triggered the workflow
git checkout "$BRANCH_NAME"
# Bump minor version in Cargo.toml
# Bump minor version and reset patch version in Cargo.toml
VERSION_LINE=$(grep "^version" ./Cargo.toml | head -1)
VERSION=$(echo $VERSION_LINE | grep -oP '\d+\.\d+\.\d+')
MAJOR_VERSION=$(echo $VERSION | awk -F'.' '{print $1}')
MINOR_VERSION=$(echo $VERSION | awk -F'.' '{print $2}')
BUMPED_MINOR_VERSION=$((MINOR_VERSION + 1))
BUMPED_VERSION=$(echo $VERSION | sed "s/\.$MINOR_VERSION\./\.$BUMPED_MINOR_VERSION\./")
BUMPED_VERSION="$MAJOR_VERSION.$BUMPED_MINOR_VERSION.0"
BUMPED_VERSION_LINE=$(echo $VERSION_LINE | sed "s/$VERSION/$BUMPED_VERSION/")
sed -i "s/$VERSION_LINE/$BUMPED_VERSION_LINE/" ./Cargo.toml
Expand All @@ -91,4 +92,4 @@ jobs:
git config user.email '${{ github.actor }}@users.noreply.github.com'
git add .
git commit -m "Bump version and update CHANGELOG"
git push
git push

0 comments on commit 48f608f

Please sign in to comment.