Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use new sonatype publishing plugin
- Loading branch information
Stainless Bot
committed
Mar 22, 2024
1 parent
fa22fd7
commit d3f8fb2
Showing
7 changed files
with
45 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
plugins { | ||
id("io.github.gradle-nexus.publish-plugin") version "1.1.0" | ||
} | ||
|
||
allprojects { | ||
group = "com.langsmith.api" | ||
version = "0.1.0-alpha.1" // x-release-please-version | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) | ||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) | ||
|
||
username.set(System.getenv("SONATYPE_USERNAME")) | ||
password.set(System.getenv("SONATYPE_PASSWORD")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
kotlin("jvm") version "1.9.22" | ||
id("com.vanniktech.maven.publish") version "0.28.0" | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22") | ||
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,52 @@ | ||
import com.vanniktech.maven.publish.MavenPublishBaseExtension | ||
import com.vanniktech.maven.publish.SonatypeHost | ||
import org.gradle.api.publish.PublishingExtension | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.create | ||
import org.gradle.kotlin.dsl.get | ||
|
||
plugins { | ||
`maven-publish` | ||
`signing` | ||
id("com.vanniktech.maven.publish") | ||
} | ||
|
||
configure<PublishingExtension> { | ||
publications { | ||
create<MavenPublication>("maven") { | ||
from(components["java"]) | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
pom { | ||
name.set("LangSmith") | ||
description.set("An SDK library for LangSmith") | ||
url.set("https://docs.LangSmith.com") | ||
extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY") | ||
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID") | ||
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD") | ||
|
||
licenses { | ||
license { | ||
name.set("Apache-2.0") | ||
} | ||
} | ||
configure<MavenPublishBaseExtension> { | ||
signAllPublications() | ||
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) | ||
|
||
developers { | ||
developer { | ||
name.set("Lang Smith") | ||
email.set("[email protected]") | ||
} | ||
} | ||
this.coordinates(project.group.toString(), project.name, project.version.toString()) | ||
|
||
scm { | ||
connection.set("scm:git:git://github.com/langchain-ai/langsmith-java.git") | ||
developerConnection.set("scm:git:git://github.com/langchain-ai/langsmith-java.git") | ||
url.set("https://github.com/langchain-ai/langsmith-java") | ||
} | ||
pom { | ||
name.set("LangSmith") | ||
description.set("An SDK library for LangSmith") | ||
url.set("https://docs.LangSmith.com") | ||
|
||
versionMapping { | ||
allVariants { | ||
fromResolutionResult() | ||
} | ||
} | ||
licenses { | ||
license { | ||
name.set("Apache-2.0") | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null } | ||
val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null } | ||
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null } | ||
if (signingKey != null && signingPassword != null) { | ||
useInMemoryPgpKeys( | ||
signingKeyId, | ||
signingKey, | ||
signingPassword, | ||
) | ||
sign(publishing.publications["maven"]) | ||
} | ||
} | ||
developers { | ||
developer { | ||
name.set("Lang Smith") | ||
email.set("[email protected]") | ||
} | ||
} | ||
|
||
tasks.publish { | ||
dependsOn(":closeAndReleaseSonatypeStagingRepository") | ||
} | ||
scm { | ||
connection.set("scm:git:git://github.com/langchain-ai/langsmith-java.git") | ||
developerConnection.set("scm:git:git://github.com/langchain-ai/langsmith-java.git") | ||
url.set("https://github.com/langchain-ai/langsmith-java") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |