Skip to content

Commit 327cb1a

Browse files
ci: Update arcade-java deployment to use Sonatype Portal
The Stainless default for publishing Maven packages is EOL, new projects need to use the newer Sonatype portal
1 parent b62bebe commit 327cb1a

6 files changed

Lines changed: 60 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.ARCADE_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
3939
SONATYPE_PASSWORD: ${{ secrets.ARCADE_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: 30
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-6ff494eafa2c154892716407682bb2296cff4f18c45765c5fb16bdf36f452ae1.yml
33
openapi_spec_hash: 63dde2481a7d51042a241bfba232b0b0
4-
config_hash: bf64816643634a621cd0ffd93d9c4347
4+
config_hash: 9894d174e6b6fe15b31d60b296ffb6e7

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 != "arcade-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/arcade.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: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,72 @@
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("Arcade API")
13-
description.set("Reference Documentation for Arcade Engine API")
14-
url.set("https://docs.arcade.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("Arcade")
25-
email.set("dev@arcade.dev")
26-
}
27-
}
36+
coordinates(project.group.toString(), project.name, project.version.toString())
37+
configure(
38+
KotlinJvm(
39+
javadocJar = JavadocJar.Dokka("dokkaJavadoc"),
40+
sourcesJar = true,
41+
)
42+
)
2843

29-
scm {
30-
connection.set("scm:git:git://github.com/ArcadeAI/arcade-java.git")
31-
developerConnection.set("scm:git:git://github.com/ArcadeAI/arcade-java.git")
32-
url.set("https://github.com/ArcadeAI/arcade-java")
33-
}
44+
pom {
45+
name.set("Arcade API")
46+
description.set("Reference Documentation for Arcade Engine API")
47+
url.set("https://docs.arcade.dev")
3448

35-
versionMapping {
36-
allVariants {
37-
fromResolutionResult()
38-
}
39-
}
49+
licenses {
50+
license {
51+
name.set("MIT")
4052
}
4153
}
42-
}
43-
repositories {
44-
if (project.hasProperty("publishLocal")) {
45-
maven {
46-
name = "LocalFileSystem"
47-
url = uri("${rootProject.layout.buildDirectory.get()}/local-maven-repo")
54+
55+
developers {
56+
developer {
57+
name.set("Arcade")
58+
email.set("dev@arcade.dev")
4859
}
4960
}
50-
}
51-
}
5261

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

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

0 commit comments

Comments
 (0)