Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
75 changes: 0 additions & 75 deletions buildSrc/src/main/kotlin/mcp.jreleaser.gradle.kts

This file was deleted.

73 changes: 33 additions & 40 deletions buildSrc/src/main/kotlin/mcp.publishing.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,58 +1,51 @@
plugins {
`maven-publish`
id("com.vanniktech.maven.publish")
signing
}

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
publications.withType<MavenPublication>().configureEach {
if (name.contains("jvm", ignoreCase = true)) {
artifact(javadocJar)
}
mavenPublishing {
signAllPublications()
publishToMavenCentral(automaticRelease = true)
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automaticRelease = true configuration may be too aggressive for production releases. Consider setting this to false to allow manual review and release of staged artifacts in Maven Central.

Suggested change
publishToMavenCentral(automaticRelease = true)
publishToMavenCentral(automaticRelease = false)

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@kpavlov kpavlov Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it makes sense to play with automaticRelease=false first? But feel free to ignore my comment


pom {
name = project.name
description = "Kotlin implementation of the Model Context Protocol (MCP)"
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
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"
}
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"
}
organization {
name = "Anthropic"
url = "https://www.anthropic.com"
}

developers {
developer {
id = "JetBrains"
name = "JetBrains Team"
organization = "JetBrains"
organizationUrl = "https://www.jetbrains.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:[email protected]:modelcontextprotocol/kotlin-sdk.git"
}
scm {
url = "https://github.com/modelcontextprotocol/kotlin-sdk"
connection = "scm:git:git://github.com/modelcontextprotocol/kotlin-sdk.git"
developerConnection = "scm:git:[email protected]:modelcontextprotocol/kotlin-sdk.git"
}
}
}

publishing {
repositories {
maven {
name = "staging"
url = uri(layout.buildDirectory.dir("staging-deploy"))
}
mavenLocal()
}
}

Comment on lines +46 to 51
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publishing block configuration appears redundant since mavenPublishing already configures Maven Central publishing. The mavenLocal() repository may not be necessary unless specifically needed for local testing.

Copilot uses AI. Check for mistakes.
Expand All @@ -68,4 +61,4 @@ signing {
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
sign(publishing.publications)
}
}
}
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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" }
Expand Down
1 change: 0 additions & 1 deletion kotlin-sdk-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
id("mcp.multiplatform")
id("mcp.publishing")
id("mcp.dokka")
id("mcp.jreleaser")
alias(libs.plugins.kotlinx.binary.compatibility.validator)
}

Expand Down
1 change: 0 additions & 1 deletion kotlin-sdk-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {
id("mcp.multiplatform")
id("mcp.publishing")
id("mcp.dokka")
id("mcp.jreleaser")
alias(libs.plugins.kotlinx.binary.compatibility.validator)
}

Expand Down
1 change: 0 additions & 1 deletion kotlin-sdk-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("mcp.multiplatform")
id("mcp.publishing")
id("mcp.dokka")
id("mcp.jreleaser")
alias(libs.plugins.kotlinx.binary.compatibility.validator)
}

Expand Down
1 change: 0 additions & 1 deletion kotlin-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("mcp.multiplatform")
id("mcp.publishing")
id("mcp.jreleaser")
}

kotlin {
Expand Down
Loading