Skip to content

Commit

Permalink
Add signing for release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Aug 8, 2023
1 parent 0bfb43a commit 81381d9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
}

Expand Down Expand Up @@ -98,6 +99,16 @@ nexusPublishing {
}
}

Boolean isReleaseVersion = !version.toString().endsWith("SNAPSHOT")

signing {
setRequired({
isReleaseVersion && gradle.taskGraph.hasTask("publish")
})
useGpgCmd()
sign configurations.archives
}

jar {
manifest {
attributes 'Implementation-Version': project.version
Expand Down

0 comments on commit 81381d9

Please sign in to comment.