From 05e3d380a5160069639ec3c399e60b7a31479fe7 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Tue, 1 Dec 2020 10:37:12 +0100 Subject: [PATCH] Setting up release scripts --- .gitignore | 4 ++++ pom.xml | 12 ++++++++++++ release.sh | 12 +++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c7d7048..776f74f 100755 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,7 @@ dependency-reduced-pom.xml .vscode/ .flattened-pom.xml .sdkmanrc +release.properties +pom.xml.next +pom.xml.releaseBackup +pom.xml.tag diff --git a/pom.xml b/pom.xml index 7f92a3d..d0d5e64 100644 --- a/pom.xml +++ b/pom.xml @@ -192,5 +192,17 @@ + + + + org.apache.maven.plugins + maven-release-plugin + 3.0.0-M1 + + + v@{project.version} + + + diff --git a/release.sh b/release.sh index cd1f699..5188655 100755 --- a/release.sh +++ b/release.sh @@ -1,2 +1,12 @@ #!/usr/bin/env bash -git fetch --tags && ./gradlew clean build && ./gradlew createRelease && ./gradlew uploadArchives && ./gradlew closeAndReleaseRepository && git push origin master --tags \ No newline at end of file + +set -o errexit + +export DEV_VERSION="${DEV_VERSION:?You must set the next dev version}" +export RELEASE_VERSION="${RELEASE_VERSION:?You must set the next release version}" + +echo "Will release [${RELEASE_VERSION}] and then bump to dev version [${DEV_VERSION}]" +git fetch --tags && \ + ./mvnw -B -Dtag=v"${RELEASE_VERSION}" release:clean release:prepare -DreleaseVersion="${RELEASE_VERSION}" -DdevelopmentVersion="${DEV_VERSION}" && \ + ./mvnw -B -Dtag=v"${RELEASE_VERSION}" -DreleaseVersion="${RELEASE_VERSION}" -DdevelopmentVersion="${DEV_VERSION}" -Dgoals=deploy release:perform && \ + git push origin master --tags \ No newline at end of file