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

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new aa481dcf5 [MINOR] improvement(release): improve release script (#5080)
aa481dcf5 is described below

commit aa481dcf59bd7a71a24f112231265c6d0c3ad3f3
Author: mchades <[email protected]>
AuthorDate: Thu Oct 10 11:35:10 2024 +0800

    [MINOR] improvement(release): improve release script (#5080)
    
    ### What changes were proposed in this pull request?
    
     - improve release script
    
    ### Why are the changes needed?
    
    Support for repeatable execution
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    by-hand
---
 dev/release/release-build.sh | 3 ++-
 dev/release/release-tag.sh   | 1 +
 dev/release/release-util.sh  | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/dev/release/release-build.sh b/dev/release/release-build.sh
index 3fd74e9ef..a66b338dd 100755
--- a/dev/release/release-build.sh
+++ b/dev/release/release-build.sh
@@ -193,6 +193,7 @@ if [[ "$1" == "package" ]]; then
   rm -f gravitino-$GRAVITINO_VERSION-src/web/LICENSE.bin
   rm -f gravitino-$GRAVITINO_VERSION-src/web/NOTICE.bin
 
+  rm -f *.asc
   tar cvzf gravitino-$GRAVITINO_VERSION-src.tar.gz --exclude 
gravitino-$GRAVITINO_VERSION-src/.git gravitino-$GRAVITINO_VERSION-src
   echo $GPG_PASSPHRASE | $GPG --passphrase-fd 0 --armour --output 
gravitino-$GRAVITINO_VERSION-src.tar.gz.asc \
     --detach-sig gravitino-$GRAVITINO_VERSION-src.tar.gz
@@ -286,7 +287,7 @@ if [[ "$1" == "publish-release" ]]; then
   cd gravitino-$GRAVITINO_VERSION-publish
 
   # Using Nexus API documented here:
-  # 
https://support.sonatype.com/entries/39720203-Uploading-to-a-Staging-Repository-via-REST-API
+  # 
https://support.sonatype.com/hc/en-us/articles/213465868-Uploading-to-a-Nexus-Repository-2-Staging-Repository-via-REST-API
   if ! is_dry_run; then
     echo "Creating Nexus staging repository"
     repo_request="<promoteRequest><data><description>Apache Gravitino 
$GRAVITINO_VERSION (commit $git_hash)</description></data></promoteRequest>"
diff --git a/dev/release/release-tag.sh b/dev/release/release-tag.sh
index a6ae3cea3..98fc8db85 100755
--- a/dev/release/release-tag.sh
+++ b/dev/release/release-tag.sh
@@ -111,6 +111,7 @@ if ! is_dry_run; then
   rm -fr gravitino
 else
   cd ..
+  rm -rf gravitino-tag
   mv gravitino gravitino-tag
   echo "Clone with version changes and tag available as gravitino-tag in the 
output directory."
 fi
diff --git a/dev/release/release-util.sh b/dev/release/release-util.sh
index aa3913dad..ca2c69be2 100755
--- a/dev/release/release-util.sh
+++ b/dev/release/release-util.sh
@@ -219,8 +219,16 @@ function init_java {
   if [ -z "$JAVA_HOME" ]; then
     error "JAVA_HOME is not set."
   fi
+  echo "JAVA_HOME is $JAVA_HOME"
+
+  if [ -x "${JAVA_HOME}/bin/javac" ]; then
+      JAVA_VERSION=$("${JAVA_HOME}/bin/javac" -version 2>&1 | cut -d " " -f 2)
+  else
+      error "javac not found in ${JAVA_HOME}/bin, please ensure you have a JDK 
installed."
+  fi
   JAVA_VERSION=$("${JAVA_HOME}"/bin/javac -version 2>&1 | cut -d " " -f 2)
   export JAVA_VERSION
+  echo "Java version is $JAVA_VERSION"
 }
 
 function init_gradle {

Reply via email to