|
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 | | - |
6 | 1 | plugins { |
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 | | - } |
| 2 | + `maven-publish` |
| 3 | + signing |
19 | 4 | } |
20 | 5 |
|
21 | | -repositories { |
22 | | - gradlePluginPortal() |
23 | | - mavenCentral() |
24 | | -} |
| 6 | +configure<PublishingExtension> { |
| 7 | + publications { |
| 8 | + register<MavenPublication>("maven") { |
| 9 | + from(components["java"]) |
25 | 10 |
|
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") |
| 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") |
29 | 15 |
|
30 | | -configure<MavenPublishBaseExtension> { |
31 | | - if (!project.hasProperty("publishLocal")) { |
32 | | - signAllPublications() |
33 | | - publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) |
34 | | - } |
| 16 | + licenses { |
| 17 | + license { |
| 18 | + name.set("MIT") |
| 19 | + } |
| 20 | + } |
35 | 21 |
|
36 | | - coordinates(project.group.toString(), project.name, project.version.toString()) |
37 | | - configure( |
38 | | - KotlinJvm( |
39 | | - javadocJar = JavadocJar.Dokka("dokkaJavadoc"), |
40 | | - sourcesJar = true, |
41 | | - ) |
42 | | - ) |
| 22 | + developers { |
| 23 | + developer { |
| 24 | + name.set("Stagehand") |
| 25 | + } |
| 26 | + } |
43 | 27 |
|
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") |
| 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 | + } |
48 | 33 |
|
49 | | - licenses { |
50 | | - license { |
51 | | - name.set("MIT") |
| 34 | + versionMapping { |
| 35 | + allVariants { |
| 36 | + fromResolutionResult() |
| 37 | + } |
| 38 | + } |
52 | 39 | } |
53 | 40 | } |
54 | | - |
55 | | - developers { |
56 | | - developer { |
57 | | - name.set("Stagehand") |
| 41 | + } |
| 42 | + repositories { |
| 43 | + if (project.hasProperty("publishLocal")) { |
| 44 | + maven { |
| 45 | + name = "LocalFileSystem" |
| 46 | + url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo") |
58 | 47 | } |
59 | 48 | } |
| 49 | + } |
| 50 | +} |
60 | 51 |
|
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 | | - } |
| 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"]) |
66 | 63 | } |
67 | 64 | } |
68 | 65 |
|
69 | | -tasks.withType<Zip>().configureEach { |
70 | | - isZip64 = true |
| 66 | +tasks.named("publish") { |
| 67 | + dependsOn(":closeAndReleaseSonatypeStagingRepository") |
71 | 68 | } |
0 commit comments