From ea1a9a2e34c856ff199b2aaf32303b3c6603286a Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Tue, 21 Dec 2021 20:31:20 -0600 Subject: [PATCH] This should allow the build to no longer require signing to be setup. --- lib/ac-api/build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ac-api/build.gradle b/lib/ac-api/build.gradle index 1d20ba3..c542ae1 100644 --- a/lib/ac-api/build.gradle +++ b/lib/ac-api/build.gradle @@ -4,6 +4,9 @@ plugins { id 'signing' } +ext.isSnapshotVersion = version.endsWith("SNAPSHOT") +ext.isReleaseVersion = !ext.isSnapshotVersion + repositories { mavenCentral() } @@ -38,6 +41,10 @@ java { } signing { + // Only sign if we're uploading... + required { + isReleaseVersion && gradle.taskGraph.hasTask("publish") + } sign configurations.archives } @@ -74,7 +81,7 @@ publishing { maven { def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl + url = isSnapshotVersion ? snapshotsRepoUrl : releasesRepoUrl credentials { username = findProperty('ossrhUsername') password = findProperty('ossrhPassword')