Skip to content

Commit

Permalink
Create prepare-release-j.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
anshooarora committed Jan 6, 2025
1 parent f171c33 commit 1375889
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions prepare-release-j.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# args
NEW_VERSION=$1


POM_FILES=(
"./core/chaintest-core-java/pom.xml"
"./plugins/chaintest-cucumber-jvm/pom.xml"
"./plugins/chaintest-junit5/pom.xml"
"./plugins/chaintest-testng/pom.xml"
"./examples/chaintest-cucumber-jvm-example/pom.xml"
"./examples/chaintest-junit5-example/pom.xml"
"./examples/chaintest-testng-example/pom.xml"
)

update_versions() {
local new_version=$1
if [ -z "$new_version" ]; then
echo "No version provided to update."
exit 1
fi

for POM_FILE in "${POM_FILES[@]}"; do
sed -i '' "1,/<version>[^<]*<\/version>/s/<version>[^<]*<\/version>/<version>$new_version<\/version>/" "$POM_FILE"
echo "Updated version to $new_version in $POM_FILE"
done
}

update_versions $NEW_VERSION

0 comments on commit 1375889

Please sign in to comment.