Skip to content

Commit f1fdf8a

Browse files
Configure PGP signing
1 parent 8f26088 commit f1fdf8a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

gradle/publish.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
23

34
publishing {
45
publications.all { publication ->
@@ -41,4 +42,16 @@ publishing {
4142
}
4243
}
4344
}
45+
}
46+
47+
signing {
48+
required { isReleaseBuild() }
49+
if (isReleaseBuild()) {
50+
useInMemoryPgpKeys(System.getenv("PGP_SIGNING_KEY"), System.getenv("PGP_SIGNING_PASSWORD"))
51+
sign publishing.publications
52+
}
53+
}
54+
55+
def isReleaseBuild() {
56+
return !scmVersion.version.contains("SNAPSHOT")
4457
}

0 commit comments

Comments
 (0)