From d1713951dd1b102b57e51e3133c44632d1164251 Mon Sep 17 00:00:00 2001 From: RicardoJiang <2868405029@qq.com> Date: Fri, 20 Jan 2023 10:07:20 +0800 Subject: [PATCH] MOD: auto release artifacts (#18) --- publish.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) mode change 100644 => 100755 publish.sh diff --git a/publish.sh b/publish.sh old mode 100644 new mode 100755 index f92f311..4ced91f --- a/publish.sh +++ b/publish.sh @@ -1 +1,11 @@ -./gradlew publishAllPublicationsToMavenCentral \ No newline at end of file +getProp(){ + grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//' +} +publishVersion=$(getProp VERSION_NAME) +snapshotSuffix='SNAPSHOT' + +./gradlew publishAllPublicationsToMavenCentral +if [[ "$publishVersion" != *"$snapshotSuffix"* ]]; then + echo "auto release artifacts of ${publishVersion}" + ./gradlew closeAndReleaseRepository +fi \ No newline at end of file