migration from jreleaser to mavenPublish plugin (#277)
#152 ## Motivation and Context To simplify publishing, use the [recommended plugin](https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-publish-libraries.html#set-up-the-publishing-plugin) ## 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 - [x] 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
edbd31d381
commit
d909835025
9 changed files with 43 additions and 149 deletions
30
.github/workflows/gradle-publish.yml
vendored
30
.github/workflows/gradle-publish.yml
vendored
|
|
@ -33,36 +33,16 @@ jobs:
|
|||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Verify publication configuration
|
||||
run: ./gradlew jreleaserConfig
|
||||
env:
|
||||
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
|
||||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
|
||||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
|
||||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Clean Build with Gradle
|
||||
run: ./gradlew clean build
|
||||
env:
|
||||
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
|
||||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
|
||||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
|
||||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
|
||||
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
|
||||
|
||||
- name: Publish to Maven Central Portal
|
||||
id: publish
|
||||
run: ./gradlew publish jreleaserFullRelease --info --stacktrace -Djreleaser.verbose=true
|
||||
run: ./gradlew publishToMavenCentral --no-configuration-cache
|
||||
env:
|
||||
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
|
||||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
|
||||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
|
||||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
|
||||
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSPHRASE }}
|
||||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
|
||||
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ dependencies {
|
|||
implementation(libs.kotlin.serialization)
|
||||
implementation(libs.kotlinx.atomicfu.gradle)
|
||||
implementation(libs.dokka.gradle)
|
||||
implementation(libs.jreleaser.gradle)
|
||||
}
|
||||
implementation(libs.maven.publish)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
import org.jreleaser.model.Active
|
||||
|
||||
plugins {
|
||||
id("org.jreleaser")
|
||||
id("mcp.publishing")
|
||||
}
|
||||
|
||||
jreleaser {
|
||||
gitRootSearch = true
|
||||
strict = true
|
||||
|
||||
signing {
|
||||
active = Active.ALWAYS
|
||||
armored = true
|
||||
artifacts = true
|
||||
files = true
|
||||
}
|
||||
|
||||
deploy {
|
||||
active = Active.ALWAYS
|
||||
maven {
|
||||
active = Active.ALWAYS
|
||||
mavenCentral.create("ossrh") {
|
||||
active = Active.ALWAYS
|
||||
sign = true
|
||||
url = "https://central.sonatype.com/api/v1/publisher"
|
||||
applyMavenCentralRules = false
|
||||
maxRetries = 240
|
||||
stagingRepository(layout.buildDirectory.dir("staging-deploy").get().asFile.path)
|
||||
|
||||
// workaround: https://github.com/jreleaser/jreleaser/issues/1784
|
||||
afterEvaluate {
|
||||
publishing.publications.forEach { publication ->
|
||||
if (publication is MavenPublication) {
|
||||
val pubName = publication.name
|
||||
|
||||
if (!pubName.contains("jvm", ignoreCase = true)
|
||||
&& !pubName.contains("metadata", ignoreCase = true)
|
||||
&& !pubName.contains("kotlinMultiplatform", ignoreCase = true)
|
||||
) {
|
||||
artifactOverride {
|
||||
artifactId = when {
|
||||
pubName.contains("wasm", ignoreCase = true) ->
|
||||
"${project.name}-wasm-${pubName.lowercase().substringAfter("wasm")}"
|
||||
|
||||
else -> "${project.name}-${pubName.lowercase()}"
|
||||
}
|
||||
jar = false
|
||||
verifyPom = false
|
||||
sourceJar = false
|
||||
javadocJar = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checksum {
|
||||
individual = false
|
||||
artifacts = false
|
||||
files = false
|
||||
}
|
||||
}
|
||||
|
||||
release {
|
||||
github {
|
||||
skipRelease = true
|
||||
skipTag = true
|
||||
overwrite = false
|
||||
token = "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,58 +1,51 @@
|
|||
plugins {
|
||||
`maven-publish`
|
||||
id("com.vanniktech.maven.publish")
|
||||
signing
|
||||
}
|
||||
|
||||
val javadocJar by tasks.registering(Jar::class) {
|
||||
archiveClassifier.set("javadoc")
|
||||
mavenPublishing {
|
||||
signAllPublications()
|
||||
publishToMavenCentral(automaticRelease = true)
|
||||
|
||||
pom {
|
||||
name = project.name
|
||||
description = "Kotlin implementation of the Model Context Protocol (MCP)"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name = "MIT License"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
|
||||
distribution = "repo"
|
||||
}
|
||||
}
|
||||
|
||||
organization {
|
||||
name = "Anthropic"
|
||||
url = "https://www.anthropic.com"
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id = "JetBrains"
|
||||
name = "JetBrains Team"
|
||||
organization = "JetBrains"
|
||||
organizationUrl = "https://www.jetbrains.com"
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
|
||||
developerConnection = "scm:git:git@github.com:modelcontextprotocol/kotlin-sdk.git"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications.withType<MavenPublication>().configureEach {
|
||||
if (name.contains("jvm", ignoreCase = true)) {
|
||||
artifact(javadocJar)
|
||||
}
|
||||
|
||||
pom {
|
||||
name = project.name
|
||||
description = "Kotlin implementation of the Model Context Protocol (MCP)"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name = "MIT License"
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk/blob/main/LICENSE"
|
||||
distribution = "repo"
|
||||
}
|
||||
}
|
||||
|
||||
organization {
|
||||
name = "Anthropic"
|
||||
url = "https://www.anthropic.com"
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
id = "JetBrains"
|
||||
name = "JetBrains Team"
|
||||
organization = "JetBrains"
|
||||
organizationUrl = "https://www.jetbrains.com"
|
||||
}
|
||||
}
|
||||
|
||||
scm {
|
||||
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
|
||||
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
|
||||
developerConnection = "scm:git:git@github.com:modelcontextprotocol/kotlin-sdk.git"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "staging"
|
||||
url = uri(layout.buildDirectory.dir("staging-deploy"))
|
||||
}
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,4 +61,4 @@ signing {
|
|||
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
|
||||
sign(publishing.publications)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ dokka = "2.0.0"
|
|||
atomicfu = "0.29.0"
|
||||
ktlint = "13.1.0"
|
||||
kover = "0.9.1"
|
||||
mavenPublish = "0.34.0"
|
||||
binaryCompatibilityValidatorPlugin = "0.18.1"
|
||||
|
||||
# libraries version
|
||||
serialization = "1.9.0"
|
||||
|
|
@ -13,8 +15,6 @@ coroutines = "1.10.2"
|
|||
kotlinx-io = "0.8.0"
|
||||
ktor = "3.3.0"
|
||||
logging = "7.0.13"
|
||||
jreleaser = "1.19.0"
|
||||
binaryCompatibilityValidatorPlugin = "0.18.1"
|
||||
slf4j = "2.0.17"
|
||||
kotest = "6.0.3"
|
||||
awaitility = "4.3.0"
|
||||
|
|
@ -30,7 +30,7 @@ kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.
|
|||
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
|
||||
kotlinx-atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
|
||||
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
|
||||
jreleaser-gradle = { module = "org.jreleaser:jreleaser-gradle-plugin", version.ref = "jreleaser" }
|
||||
maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublish" }
|
||||
|
||||
# Kotlinx libraries
|
||||
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ plugins {
|
|||
id("mcp.multiplatform")
|
||||
id("mcp.publishing")
|
||||
id("mcp.dokka")
|
||||
id("mcp.jreleaser")
|
||||
alias(libs.plugins.kotlinx.binary.compatibility.validator)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ plugins {
|
|||
id("mcp.multiplatform")
|
||||
id("mcp.publishing")
|
||||
id("mcp.dokka")
|
||||
id("mcp.jreleaser")
|
||||
alias(libs.plugins.kotlinx.binary.compatibility.validator)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ plugins {
|
|||
id("mcp.multiplatform")
|
||||
id("mcp.publishing")
|
||||
id("mcp.dokka")
|
||||
id("mcp.jreleaser")
|
||||
alias(libs.plugins.kotlinx.binary.compatibility.validator)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
plugins {
|
||||
id("mcp.multiplatform")
|
||||
id("mcp.publishing")
|
||||
id("mcp.jreleaser")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
|
|
|
|||
Loading…
Reference in a new issue