-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·41 lines (33 loc) · 1 KB
/
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
37
38
39
40
41
#!/usr/bin/env bash
RELEASE_VERSION=$1
DEVELOPMENT_VERSION=$2
VERSION_VALIDATION_REGEX='^([0-9]+\.){2,2}(\*|[0-9]+)$'
if [ -z "$RELEASE_VERSION" ]
then
echo "ERROR: No release version supplied"
exit 1
fi
if [ -z "$DEVELOPMENT_VERSION" ]
then
echo "ERROR: No development version supplied"
exit 1
fi
validate_version () {
VERSION=$1
if [[ ! $VERSION =~ $VERSION_VALIDATION_REGEX ]]; then
echo "ERROR: Invalid version '$VERSION'"
echo "INFO: Valid version format MAJOR.MINOR.PATCH see https://semver.org/"
exit 1
fi
}
validate_version $RELEASE_VERSION
validate_version $DEVELOPMENT_VERSION
git checkout master &&
git pull &&
if [ $(git tag -l "cubes-$RELEASE_VERSION") ]
then
echo "Version $RELEASE_VERSION already exists. Release aborted!"
exit 1
fi
./mvnw --settings settings.xml -B release:clean release:prepare release:perform -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION-SNAPSHOT &&
. ./sync-version-artifacts-to-maven-central.sh