This is an automated email from the ASF dual-hosted git repository. valdar pushed a commit to branch camel-kafka-connector-4.8.x in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git
The following commit(s) were added to refs/heads/camel-kafka-connector-4.8.x by this push: new 4aa7530ffb Improved release automation. 4aa7530ffb is described below commit 4aa7530ffbd3df0f6898da65bcd5ce0b157e878c Author: Andrea Tarocchi <andrea.taroc...@gmail.com> AuthorDate: Fri Feb 7 11:04:24 2025 +0100 Improved release automation. --- release-utils/release.sh | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/release-utils/release.sh b/release-utils/release.sh index ce79c57c4a..fe8bf5c1a7 100755 --- a/release-utils/release.sh +++ b/release-utils/release.sh @@ -17,28 +17,54 @@ prefix=camel-kafka-connector- -read -p "Enter release version: " releaseV +read -r -p "Enter release version: " releaseV export RELEASE_VERSION=$releaseV releaseVbranch="${releaseV%.*}.x" -read -p "Enter next version: " nextV +read -r -p "Enter next version: " nextV export NEXT_VERSION=$nextV defaultReleaseBranch=$prefix$releaseVbranch -read -p "Enter release branch [$defaultReleaseBranch]: " releaseBranch +read -r -p "Enter release branch [$defaultReleaseBranch]: " releaseBranch export RELEASE_BRANCH=${releaseBranch:-$defaultReleaseBranch} defaultReleaseTag=$prefix$releaseV -read -p "Enter release tag: [$defaultReleaseTag]" releaseTag +read -r -p "Enter release tag: [$defaultReleaseTag]" releaseTag export RELEASE_TAG=${releaseTag:-$defaultReleaseTag} -read -p "Enter apache username: " user +read -r -p "Enter apache username: " user export APACHE_USER=$user -read -p "Enter apache password: " pass +read -r -s -p "Enter apache password: " pass export APACHE_PASS=$pass +echo "" -git checkout -b $RELEASE_BRANCH && \ -./mvnw -Prelease -Pgpg -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$NEXT_VERSION -Dtag=$RELEASE_TAG -Dusername=$APACHE_USER -Dpassword=$APACHE_PASS release:prepare && \ -git checkout $RELEASE_TAG && git add *.json && git commit -m"[after release perform chore]: regen catalog descriptors with new version" && git tag -f $RELEASE_TAG && git push -f upstream $RELEASE_TAG && git checkout $RELEASE_BRANCH && \ -./mvnw -Prelease -Pgpg -Dusername=$APACHE_USER -Dpassword=$APACHE_PASS release:perform +defaultGpgProfile=gpg +read -r -p "Enter the maven gpg profile: [$defaultGpgProfile]" gpgProfile +export GPG_PROFILE=${gpgProfile:-$defaultGpgProfile} + +defaultCheckoutReleaseBranch=Y +while true; do + read -r -p "Do you want to automatically checkout -b into $RELEASE_BRANCH branch?: [Y/n]" checkoutReleaseBranch + checkoutReleaseBranch=${checkoutReleaseBranch:-$defaultCheckoutReleaseBranch} + case $checkoutReleaseBranch in + [Yy]* ) + export CHECKOUT_RELEASE_TAG=Y + break + ;; + [Nn]* ) + export CHECKOUT_RELEASE_TAG=N + break + ;; + * ) + echo "Invalid input. Please enter y or n" + ;; + esac +done + +if [ "$CHECKOUT_RELEASE_TAG" == Y ]; then + git checkout -b "$RELEASE_BRANCH" +fi +./mvnw -Prelease -P"$GPG_PROFILE" -DreleaseVersion="$RELEASE_VERSION" -DdevelopmentVersion="$NEXT_VERSION" -Dtag="$RELEASE_TAG" -Dusername="$APACHE_USER" -Dpassword="$APACHE_PASS" release:prepare && \ +git checkout "$RELEASE_TAG" && git add ./*.json && git commit -m"[after release perform chore]: regen catalog descriptors with new version" && git tag -f "$RELEASE_TAG" && git push -f upstream "$RELEASE_TAG" && git checkout "$RELEASE_BRANCH" && \ +./mvnw -Prelease -Pgpg -Dusername="$APACHE_USER" -Dpassword="$APACHE_PASS" release:perform