Skip to content

Commit

Permalink
[#1095] Sign the artifacts for Sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed Dec 18, 2024
1 parent 8a4c959 commit 63d2792
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ publishing {
// Signing

var signingExtension = project.getExtensions().getByType(SigningExtension) as SigningExtension
signingExtension.sign publishing.publications.publishedArtifacts

def signPublicationsTask = tasks.register('signPublications') {
description "Grouping task which executes all Sign tasks"
Expand Down Expand Up @@ -111,7 +112,7 @@ gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
if ( publishUser == null || publishPass == null ) {
throw new RuntimeException( "Cannot perform publishing to OSSRH without credentials." )
}
logger.lifecycle "Publishing groupId: '" + project.group + "', version: '" + project.version + "'"
logger.lifecycle "Publishing {} : {} : {}", project.group, project.name, project.version
}

if ( wasSigningRequested || wasPublishingRequested ) {
Expand All @@ -122,7 +123,6 @@ gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
var signingKey = resolveSigningKey()
var signingPassword = resolveSigningPassphrase()
signingExtension.useInMemoryPgpKeys( signingKey, signingPassword )
signingExtension.sign publishing.publications.publishedArtifacts
}
else {
// signing was not explicitly requested and we are not publishing to OSSRH,
Expand Down

0 comments on commit 63d2792

Please sign in to comment.