forked from SpectoLabs/hoverfly-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maven-release.sh
29 lines (22 loc) · 884 Bytes
/
maven-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
#!/usr/bin/env bash
set -v
set -e
git config user.email "[email protected]"
git config user.name "CircleCI"
PROJECT_VERSION=($(cat gradle.properties | grep version | cut -d '=' -f 2))
echo "Project version: ${PROJECT_VERSION[0]}"
echo "Is release?: ${IS_RELEASE}"
echo "Release version: ${RELEASE_VERSION}"
echo "Next dev version: ${NEXT_DEV_VERSION}"
if [[ "${PROJECT_VERSION[0]}" == *"SNAPSHOT" ]]; then
echo "Detected snapshot version"
if [ "${IS_RELEASE}" = true ]; then
echo "Performing a release"
./gradlew :release -Prelease.releaseVersion=${RELEASE_VERSION} -Prelease.newVersion=${NEXT_DEV_VERSION} -x :junit5:createReleaseTag
else
echo "Deploying snapshot version"
./gradlew uploadArchives
fi
else
echo "This commit is a change of release version, so doing nothing (A release was performed by the previous job)"
fi