-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathperform-release.sh
executable file
·36 lines (28 loc) · 1.01 KB
/
perform-release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
function getVersion() {
VERSION=`./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --no-transfer-progress --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec | tail -n 1`
echo ${VERSION}
}
set +e
git diff --exit-code >/dev/null 2>&1
GIT_STATUS=$?
set -e
export JAVA_HOME=${JAVA_HOME:-$JDK_18_x64}
echo "Java version: "
echo $JAVA_HOME
export PATH=$JAVA_HOME/bin:$PATH
java -version
if [[ ! GIT_STATUS -eq 0 ]]
then
echo "Aborting due to uncommited changes"
exit 1
fi
RELEASE_VERSION=$(getVersion)
echo "Performing release ${RELEASE_VERSION}"
echo "Deploying release ${RELEASE_VERSION}"
./mvnw clean deploy -DskipTests -Prelease,javadoc-jdk-8u121
git tag -a v${RELEASE_VERSION} -m 'TASK Release v${RELEASE_VERSION}'
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
git push origin ${CURRENT_BRANCH} --tags
#echo "Publish release javadoc ${RELEASE_VERSION}"
#./mvnw javadoc:aggregate scm-publish:publish-scm -Pgh-publish-site,javadoc-jdk-8u121 --no-transfer-progress