This is an automated email from the ASF dual-hosted git repository.

arvid pushed a commit to branch release_utils
in repository 
https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git


The following commit(s) were added to refs/heads/release_utils by this push:
     new d15b90d  Adding support for TARGET_VERSION, detect mvnw, and warn 
about mac sed
d15b90d is described below

commit d15b90de64799764d814c0b1ab2ee5e5e3baa1db
Author: Arvid Heise <[email protected]>
AuthorDate: Wed Apr 9 13:12:45 2025 +0200

    Adding support for TARGET_VERSION, detect mvnw, and warn about mac sed
---
 README.md            | 11 +++++++++++
 _init.sh             | 12 ++++++++++--
 check_environment.sh | 15 +++++++++++----
 stage_jars.sh        |  2 +-
 4 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index c0c2fc3..198bddc 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,17 @@ under `tools/releasing/shared`.
 # Usage
 
 Some scripts rely on environment variables to be set.  
+```
+export NEW_VERSION=3.0.0
+export TARGET_JAVA_VERSION=8
+export RC_NUM=1
+export PROJECT=flink-connector-<project>
+export REMOTE=origin
+export MAVEN_SKIP_RC=false
+export MAVEN_OPTS=""
+export MAVEN_CONFIG=""
+export MAVEN_DEBUG_OPTS=""
+```
 These are checked at the start of each script.  
 Any instance of `${some_variable}` in this document refers to an environment 
variable that is used by the respective
 script.
diff --git a/_init.sh b/_init.sh
index 35b3111..060d709 100644
--- a/_init.sh
+++ b/_init.sh
@@ -28,7 +28,7 @@ export SHELLOPTS
 
 ###########################
 
-MVN=${MVN:-mvn}
+TARGET_JAVA_VERSION=${TARGET_JAVA_VERSION:-8}
 
 if [ "$(uname)" == "Darwin" ]; then
     SHASUM="shasum -a 512"
@@ -45,4 +45,12 @@ RELEASE_DIR=${SOURCE_DIR}/tools/releasing/release
 ARTIFACTS_DIR=${SOURCE_DIR}/tools/releasing/release/artifacts
 
 SVN_DEV_DIR="https://dist.apache.org/repos/dist/dev/flink";
-SVN_RELEASE_DIR="https://dist.apache.org/repos/dist/release/flink";
\ No newline at end of file
+SVN_RELEASE_DIR="https://dist.apache.org/repos/dist/release/flink";
+
+if [ -n "MVN" ]; then
+  if [ -e "${SOURCE_DIR}/mvnw" ]; then
+    MVN=${SOURCE_DIR}/mvnw
+  else
+    MVN=mvn
+  fi
+fi
diff --git a/check_environment.sh b/check_environment.sh
index b2ad38c..62c5677 100755
--- a/check_environment.sh
+++ b/check_environment.sh
@@ -24,7 +24,7 @@ source "${SCRIPT_DIR}/_init.sh"
 EXIT_CODE=0
 
 function check_program_available {
-  if program=$(command -v ${1}); then
+  if program=$(command -v ${2:-${1}}); then
     printf "\t%-10s%s\n" "${1}" "using ${program}"
   else
     printf "\t%-10s%s\n" "${1}" "is not available."
@@ -40,8 +40,15 @@ check_program_available gpg
 check_program_available perl
 check_program_available sed
 check_program_available svn
-check_program_available ${MVN}
-check_program_available ${SHASUM}
+check_program_available "\${MVN}" ${MVN}
+check_program_available "\${SHASUM}" ${SHASUM}
+
+if ! (sed --version 2>/dev/null | grep -q "GNU"); then
+  echo "Warning: You are not using GNU sed. Some scripts may not work. If you 
are using Mac, install gnu-sed (brew install gnu-sed) and make sure that sed 
points to it (alias sed=\"gsed\")."
+fi
+
+echo -e "\nMaven/Java version:"
+${MVN} --version
 
 function check_git_connectivity {
   cd "${SOURCE_DIR}"
@@ -54,7 +61,7 @@ function check_git_connectivity {
   fi
 }
 
-echo "Checking git remote availability:"
+echo -e "\nChecking git remote availability:"
 if ! (check_git_connectivity); then
   EXIT_CODE=1
 fi
diff --git a/stage_jars.sh b/stage_jars.sh
index 84e9c89..67bc415 100755
--- a/stage_jars.sh
+++ b/stage_jars.sh
@@ -51,7 +51,7 @@ function deploy_staging_jars {
 
   options="-Prelease,docs-and-source -DskipTests 
-DretryFailedDeploymentCount=10"
   set +u
-  ${MVN} clean deploy ${options} -Dflink.version=${FLINK_VERSION}
+  ${MVN} clean deploy ${options} -Dflink.version=${FLINK_VERSION} 
-Dtarget.java.version=${TARGET_JAVA_VERSION}
   set -u
 
   cd "${RELEASE_DIR}"

Reply via email to