Skip to content

Commit

Permalink
build: Fix publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
matrei committed Oct 25, 2024
1 parent da361e7 commit 0be3b9a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ext.set('signing.password', findProperty('signing.password') ?: System.getenv('S
def javaComponent = components.named('java')
publishing {
publications {
register('grailsMailPlugin', MavenPublication) {
maven(MavenPublication) {
from javaComponent.get()
versionMapping {
usage('java-api') { fromResolutionOf('runtimeClasspath') }
Expand Down Expand Up @@ -91,14 +91,13 @@ publishing {
}
}

def mavenPublication = extensions.findByType(PublishingExtension).publications.named('grailsMailPlugin')
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}
afterEvaluate {
signing {
required = { isReleaseVersion }
sign(mavenPublication.get())
required = { isReleaseVersion && gradle.taskGraph.hasTask('publish') }
sign(publishing.publications.maven)
}
}

Expand Down

0 comments on commit 0be3b9a

Please sign in to comment.