Skip to content

Commit

Permalink
Sign publications (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefMa authored Nov 27, 2023
1 parent f1b1e10 commit fb56b73
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.kotlinDokka)
`maven-publish`
signing
}

repositories {
Expand Down Expand Up @@ -123,3 +124,19 @@ publishing {
}
}
}

signing {
val signingKey = System.getenv("GPG_SIGNING_KEY")
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}

// Workaround taken from here:
// https://github.com/gradle/gradle/issues/26091#issuecomment-1722947958
// Maybe fix can be found here:
// https://github.com/gradle/gradle/pull/26292
tasks.withType<AbstractPublishToMaven>().configureEach {
val signingTasks = tasks.withType<Sign>()
mustRunAfter(signingTasks)
}

0 comments on commit fb56b73

Please sign in to comment.