diff --git a/build.gradle b/build.gradle index 65d8d91..615926a 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { } plugins { - id 'net.nemerosa.versioning' version '2.0.0' + id 'net.nemerosa.versioning' version '2.6.1' } apply plugin: 'java' @@ -60,9 +60,10 @@ artifacts { } versioning { - releaseMode = 'snapshot' // how to compute version on release-branches - displayMode = 'snapshot' // how to compute version on non-release-branches - dirty = { t -> t } // switch off dirty-suffix ( could be usefull for local development ) + releaseBuild = VERSIONING_RELEASE_BUILD + releaseMode = VERSIONING_RELEASE_MODE + displayMode = VERSIONING_DISPLAY_MODE + dirty = { t -> t } } apply from: 'publishToMaven.gradle' diff --git a/gradle.properties b/gradle.properties index 986ab90..e3d90e4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,4 +15,8 @@ POM_DEVELOPER_ID=shyamz-22 POM_DEVELOPER_NAME=Syamala Umamaheswaran RELEASE_REPOSITORY_URL=https://oss.sonatype.org/service/local/staging/deploy/maven2 -SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots \ No newline at end of file +SNAPSHOT_REPOSITORY_URL=https://oss.sonatype.org/content/repositories/snapshots + +VERSIONING_RELEASE_BUILD=false +VERSIONING_RELEASE_MODE=snapshot +VERSIONING_DISPLAY_MODE=snapshot \ No newline at end of file diff --git a/publish/publish-patch.sh b/publish/publish-patch.sh new file mode 100755 index 0000000..79c8d7d --- /dev/null +++ b/publish/publish-patch.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -x + +set -e + + +main() { + git checkout master + + local CURRENT_BRANCH=$(git branch -a | grep 'release/' | tail -n 1) + + echo "${CURRENT_BRANCH}" + + git checkout ${CURRENT_BRANCH} + + ./gradlew clean build + + ./gradlew versionFile + + export $(cat build/version.properties | xargs) + + GIT_TAG="${VERSION_DISPLAY}" + + echo "./gradlew uploadArchives" + + echo "git tag ${GIT_TAG}" + + echo "git push --tag" + +} + + +main $* +