Skip to content

Commit

Permalink
[KYUUBI #5308] Ensure release using Java 8
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_

Avoid releasing new version with incorrect java version.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_

No.

Closes #5308 from wForget/release_check_java_version.

Closes #5308

8bf3c13 [Cheng Pan] Update build/release/release.sh
90ddd14 [wforget] comment
b6ab1a4 [wforget] Check java version for release script

Lead-authored-by: wforget <[email protected]>
Co-authored-by: Cheng Pan <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
wForget and pan3793 committed Sep 19, 2023
1 parent 2732449 commit 2abceea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions build/release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ if [[ ${RELEASE_VERSION} =~ .*-SNAPSHOT ]]; then
exit 1
fi

if [ -n "${JAVA_HOME}" ]; then
JAVA="${JAVA_HOME}/bin/java"
elif [ "$(command -v java)" ]; then
JAVA="java"
else
echo "JAVA_HOME is not set" >&2
exit 1
fi

JAVA_VERSION=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ $JAVA_VERSION != 1.8.* ]]; then
echo "Unexpected Java version: $JAVA_VERSION. Java 8 is required for release."
exit 1
fi

RELEASE_TAG="v${RELEASE_VERSION}-rc${RELEASE_RC_NO}"

SVN_STAGING_REPO="https://dist.apache.org/repos/dist/dev/kyuubi"
Expand Down

0 comments on commit 2abceea

Please sign in to comment.