Refactor signing publications (#281)
Add a new function for signing publications ## Motivation and Context In the [latest release build](https://github.com/modelcontextprotocol/kotlin-sdk/actions/runs/17830036899/job/50692417727), the artifact signing tasks were not included ## Breaking Changes no ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed
This commit is contained in:
parent
77357a1d22
commit
b1e9871a78
1 changed files with 6 additions and 9 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import com.vanniktech.maven.publish.MavenPublishBaseExtension
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`maven-publish`
|
`maven-publish`
|
||||||
id("com.vanniktech.maven.publish")
|
id("com.vanniktech.maven.publish")
|
||||||
|
|
@ -6,6 +8,7 @@ plugins {
|
||||||
|
|
||||||
mavenPublishing {
|
mavenPublishing {
|
||||||
publishToMavenCentral(automaticRelease = true)
|
publishToMavenCentral(automaticRelease = true)
|
||||||
|
configureSigning(this)
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
name = project.name
|
name = project.name
|
||||||
|
|
@ -42,13 +45,7 @@ mavenPublishing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
private fun Project.configureSigning(mavenPublishing: MavenPublishBaseExtension) {
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signing {
|
|
||||||
val gpgKeyName = "GPG_SIGNING_KEY"
|
val gpgKeyName = "GPG_SIGNING_KEY"
|
||||||
val gpgPassphraseName = "SIGNING_PASSPHRASE"
|
val gpgPassphraseName = "SIGNING_PASSPHRASE"
|
||||||
val signingKey = providers.environmentVariable(gpgKeyName)
|
val signingKey = providers.environmentVariable(gpgKeyName)
|
||||||
|
|
@ -57,7 +54,7 @@ signing {
|
||||||
.orElse(providers.gradleProperty(gpgPassphraseName))
|
.orElse(providers.gradleProperty(gpgPassphraseName))
|
||||||
|
|
||||||
if (signingKey.isPresent) {
|
if (signingKey.isPresent) {
|
||||||
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
|
mavenPublishing.signAllPublications()
|
||||||
sign(publishing.publications)
|
signing.useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue