#!/bin/bash

set -eo pipefail

if [[ $GIT_USER_EMAIL ]]; then
  git config --global user.email "$GIT_USER_EMAIL"
fi

if [[ $GIT_USER_NAME ]]; then
  git config --global user.name "$GIT_USER_NAME"
fi

if [[ $RELEASE ]]; then
  mvn -B release:prepare -DreleaseVersion=$RELEASE -DdevelopmentVersion=$NEXT -DskipTests
  mvn -B release:perform --settings=".buildscript/settings.xml" -DskipTests
  sed -i "s/<version>\(.*\)</<version>$RELEASE</" README.md
fi

#!/bin/bash

set -eo pipefail

if [[ $GIT_USER_EMAIL ]]; then
  git config --global user.email "$GIT_USER_EMAIL"
fi

if [[ $GIT_USER_NAME ]]; then
  git config --global user.name "$GIT_USER_NAME"
fi

if [[ $RELEASE ]]; then
  mvn -B release:prepare -DreleaseVersion=$RELEASE -DdevelopmentVersion=$NEXT -DskipTests
  mvn -B release:perform --settings=".buildscript/settings.xml" -DskipTests
  # Modify version in README.md
  sed -i "s/<version>\(.*\)</<version>$RELEASE</" README.md
  git add README.md
  git commit -m "Update README at $(date)"
  git push origin master
fi

Fix updating README pom section
Fix updating README pom section
