|
| 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 | + |
1 | 6 | 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 | + } |
4 | 19 | } |
5 | 20 |
|
6 | | -configure<PublishingExtension> { |
7 | | - publications { |
8 | | - register<MavenPublication>("maven") { |
9 | | - from(components["java"]) |
| 21 | +repositories { |
| 22 | + gradlePluginPortal() |
| 23 | + mavenCentral() |
| 24 | +} |
10 | 25 |
|
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") |
15 | 29 |
|
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 | + } |
21 | 35 |
|
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 | + ) |
27 | 43 |
|
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") |
33 | 48 |
|
34 | | - versionMapping { |
35 | | - allVariants { |
36 | | - fromResolutionResult() |
37 | | - } |
38 | | - } |
| 49 | + licenses { |
| 50 | + license { |
| 51 | + name.set("MIT") |
39 | 52 | } |
40 | 53 | } |
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") |
47 | 58 | } |
48 | 59 | } |
49 | | - } |
50 | | -} |
51 | 60 |
|
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 | + } |
63 | 66 | } |
64 | 67 | } |
65 | 68 |
|
66 | | -tasks.named("publish") { |
67 | | - dependsOn(":closeAndReleaseSonatypeStagingRepository") |
| 69 | +tasks.withType<Zip>().configureEach { |
| 70 | + isZip64 = true |
68 | 71 | } |
0 commit comments