Skip to content

Commit d2ff945

Browse files
authored
Merge pull request #9 from run-llama/stainless/release
Release SDK updates
2 parents aa1dffa + 59ad01d commit d2ff945

9 files changed

Lines changed: 61 additions & 163 deletions

File tree

‎.github/workflows/publish-sonatype.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
export -- GPG_SIGNING_KEY_ID
3434
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
3535
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
36-
./gradlew publish --no-configuration-cache
36+
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
3737
env:
3838
SONATYPE_USERNAME: ${{ secrets.LLAMA_CLOUD_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
3939
SONATYPE_PASSWORD: ${{ secrets.LLAMA_CLOUD_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}

‎build.gradle.kts‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
plugins {
2-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
32
id("org.jetbrains.dokka") version "2.0.0"
43
}
54

@@ -34,15 +33,3 @@ tasks.named("dokkaJavadocCollector").configure {
3433
.filter { it.project.name != "llama-cloud" && it.name == "dokkaJavadocJar" }
3534
.forEach { mustRunAfter(it) }
3635
}
37-
38-
nexusPublishing {
39-
repositories {
40-
sonatype {
41-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
42-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
43-
44-
username.set(System.getenv("SONATYPE_USERNAME"))
45-
password.set(System.getenv("SONATYPE_PASSWORD"))
46-
}
47-
}
48-
}

‎buildSrc/build.gradle.kts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
plugins {
22
`kotlin-dsl`
33
kotlin("jvm") version "1.9.20"
4+
id("com.vanniktech.maven.publish") version "0.28.0"
45
}
56

67
repositories {
78
gradlePluginPortal()
9+
mavenCentral()
810
}
911

1012
dependencies {
1113
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
14+
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
1215
}

‎buildSrc/src/main/kotlin/llama-cloud.java.gradle.kts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ repositories {
88
mavenCentral()
99
}
1010

11-
configure<JavaPluginExtension> {
12-
withJavadocJar()
13-
withSourcesJar()
14-
}
15-
1611
java {
1712
toolchain {
1813
languageVersion.set(JavaLanguageVersion.of(21))
@@ -27,10 +22,6 @@ tasks.withType<JavaCompile>().configureEach {
2722
options.release.set(8)
2823
}
2924

30-
tasks.named<Jar>("javadocJar") {
31-
setZip64(true)
32-
}
33-
3425
tasks.named<Jar>("jar") {
3526
manifest {
3627
attributes(mapOf(
Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,71 @@
1+
import com.vanniktech.maven.publish.JavadocJar
2+
import com.vanniktech.maven.publish.KotlinJvm
3+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
4+
import com.vanniktech.maven.publish.SonatypeHost
5+
16
plugins {
2-
`maven-publish`
3-
signing
7+
id("com.vanniktech.maven.publish")
8+
}
9+
10+
publishing {
11+
repositories {
12+
if (project.hasProperty("publishLocal")) {
13+
maven {
14+
name = "LocalFileSystem"
15+
url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo")
16+
}
17+
}
18+
}
419
}
520

6-
configure<PublishingExtension> {
7-
publications {
8-
register<MavenPublication>("maven") {
9-
from(components["java"])
21+
repositories {
22+
gradlePluginPortal()
23+
mavenCentral()
24+
}
1025

11-
pom {
12-
name.set("Llama Platform")
13-
description.set("An SDK library for llama-cloud")
14-
url.set("https://developers.llamaindex.ai/")
26+
extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
27+
extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
28+
extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
1529

16-
licenses {
17-
license {
18-
name.set("MIT")
19-
}
20-
}
30+
configure<MavenPublishBaseExtension> {
31+
if (!project.hasProperty("publishLocal")) {
32+
signAllPublications()
33+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
34+
}
2135

22-
developers {
23-
developer {
24-
name.set("Llama Cloud")
25-
}
26-
}
36+
coordinates(project.group.toString(), project.name, project.version.toString())
37+
configure(
38+
KotlinJvm(
39+
javadocJar = JavadocJar.Dokka("dokkaJavadoc"),
40+
sourcesJar = true,
41+
)
42+
)
2743

28-
scm {
29-
connection.set("scm:git:git://github.com/run-llama/llama-parse-java.git")
30-
developerConnection.set("scm:git:git://github.com/run-llama/llama-parse-java.git")
31-
url.set("https://github.com/run-llama/llama-parse-java")
32-
}
44+
pom {
45+
name.set("Llama Platform")
46+
description.set("An SDK library for llama-cloud")
47+
url.set("https://developers.llamaindex.ai/")
3348

34-
versionMapping {
35-
allVariants {
36-
fromResolutionResult()
37-
}
38-
}
49+
licenses {
50+
license {
51+
name.set("MIT")
3952
}
4053
}
41-
}
42-
repositories {
43-
if (project.hasProperty("publishLocal")) {
44-
maven {
45-
name = "LocalFileSystem"
46-
url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo")
54+
55+
developers {
56+
developer {
57+
name.set("Llama Cloud")
4758
}
4859
}
49-
}
50-
}
5160

52-
signing {
53-
val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
54-
val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
55-
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
56-
if (signingKey != null && signingPassword != null) {
57-
useInMemoryPgpKeys(
58-
signingKeyId,
59-
signingKey,
60-
signingPassword,
61-
)
62-
sign(publishing.publications["maven"])
61+
scm {
62+
connection.set("scm:git:git://github.com/run-llama/llama-parse-java.git")
63+
developerConnection.set("scm:git:git://github.com/run-llama/llama-parse-java.git")
64+
url.set("https://github.com/run-llama/llama-parse-java")
65+
}
6366
}
6467
}
6568

66-
tasks.named("publish") {
67-
dependsOn(":closeAndReleaseSonatypeStagingRepository")
69+
tasks.withType<Zip>().configureEach {
70+
isZip64 = true
6871
}

0 commit comments

Comments
 (0)