Skip to content

Commit 65820a9

Browse files
feat: Update stainless.yml for project and publish settings
1 parent 793e911 commit 65820a9

8 files changed

Lines changed: 62 additions & 76 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.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
3939
SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-43e6dd4ce19381de488d296e9036fea15bfea9a6f946cf8ccf4e02aecc8fb765.yml
33
openapi_spec_hash: f736e7a8acea0d73e1031c86ea803246
4-
config_hash: 75b561cd2ba925e4f2a62ec2f1d13738
4+
config_hash: b375728ccf7d33287335852f4f59c293

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ If you're looking for other languages, you can find them
6262
## What is Stagehand?
6363
The Stagehand Java SDK is similar to the Stagehand Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.
6464

65+
The Stagehand Java SDK is similar to the Stagehand Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.
66+
6567
It is generated with [Stainless](https://www.stainless.com/).
6668

6769
Stagehand is a browser automation framework used to control web browsers with natural language and code. By combining the power of AI with the precision of code, Stagehand makes web automation flexible, maintainable, and actually reliable.

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

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

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/stagehand.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("Stagehand API")
13-
description.set("Stagehand SDK for AI browser automation [ALPHA]. This API allows clients to\nexecute browser automation tasks remotely on the Browserbase cloud.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.\n\nThis SDK is currently ALPHA software and is not production ready! Please try it\nand give us your feedback, stay tuned for upcoming release announcements!")
14-
url.set("https://docs.stagehand.dev")
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("Stagehand")
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/browserbase/stagehand-java.git")
30-
developerConnection.set("scm:git:git://github.com/browserbase/stagehand-java.git")
31-
url.set("https://github.com/browserbase/stagehand-java")
32-
}
44+
pom {
45+
name.set("Stagehand API")
46+
description.set("Stagehand SDK for AI browser automation [ALPHA]. This API allows clients to\nexecute browser automation tasks remotely on the Browserbase cloud.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.\n\nThis SDK is currently ALPHA software and is not production ready! Please try it\nand give us your feedback, stay tuned for upcoming release announcements!")
47+
url.set("https://docs.stagehand.dev")
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("Stagehand")
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/browserbase/stagehand-java.git")
63+
developerConnection.set("scm:git:git://github.com/browserbase/stagehand-java.git")
64+
url.set("https://github.com/browserbase/stagehand-java")
65+
}
6366
}
6467
}
6568

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

stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/SseHandler.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal fun sseHandler(jsonMapper: JsonMapper): Handler<StreamResponse<SseMessa
2828
val message = state.decode(line) ?: continue
2929

3030
when {
31-
message.data.startsWith("finished") -> {
31+
message.data.startsWith("{\"data\":{\"status\":\"finished\"") -> {
3232
// In this case we don't break because we still want to iterate through the full
3333
// stream.
3434
done = true

0 commit comments

Comments
 (0)