Skip to content

Commit

Permalink
Fix Artifacts Signing
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Feb 17, 2023
1 parent 2c76df9 commit 5cae4fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ plugins {

ext.isSnapshot = project.projectVersion.endsWith('-SNAPSHOT')
ext.isReleaseVersion = !isSnapshot
ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')

version = project.projectVersion

allprojects {

Expand Down
10 changes: 5 additions & 5 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ plugins {
id 'java-library'
}

apply plugin: 'signing'
apply plugin: "org.grails.grails-plugin"
apply plugin: "org.grails.grails-gsp"

Expand Down Expand Up @@ -72,10 +73,6 @@ jar {
exclude "src/test/projects/**"
}

if (isReleaseVersion) {
apply plugin: "signing"
}

publishing {

if (isSnapshot) {
Expand Down Expand Up @@ -137,8 +134,11 @@ publishing {
if (isReleaseVersion) {
afterEvaluate {
signing {
required { gradle.taskGraph.hasTask("publish") || gradle.taskGraph.hasTask("publishMavenPublicationToMavenLocal") }
sign publishing.publications.maven
}
}
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}

0 comments on commit 5cae4fc

Please sign in to comment.