Skip to content

Commit

Permalink
build: don't sign local snapshot builds
Browse files Browse the repository at this point in the history
  • Loading branch information
stempler committed Oct 20, 2023
1 parent 366ae22 commit ca076a3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jar {
}
}

def isCI = "true".equals(System.getenv("CI"))
def isRelease = !version.endsWith('-SNAPSHOT')

dependencies {
implementation gradleApi()
implementation 'biz.aQute.bnd:biz.aQute.bndlib:5.2.0'
Expand Down Expand Up @@ -112,11 +115,14 @@ publishing {

// sign all artifacts
signing {
if ("true".equals(System.getenv("CI"))) {
if (isCI) { // use in ASCII armored key for CI
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
}

sign publishing.publications.mavenJava

if (isRelease || isCI) {
// only sign releases or on CI
sign publishing.publications.mavenJava
}
}

0 comments on commit ca076a3

Please sign in to comment.