Skip to content

Commit 4d93c9b

Browse files
committed
Migrate to Sonatype Central Portal
1 parent 437cd60 commit 4d93c9b

File tree

16 files changed

+280
-298
lines changed

16 files changed

+280
-298
lines changed

.github/workflows/publish-new-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,13 @@ jobs:
6565
file-path: ./buildSrc/src/main/kotlin/io/getstream/chat/android/Configuration.kt
6666
release-notes: ${{ needs.generate_release_notes.outputs.release_notes }}
6767
excluded-modules: "stream-chat-android-ui-components-sample,stream-chat-android-compose-sample,stream-chat-android-docs"
68+
use-official-plugin: false
6869
secrets:
6970
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
7071
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
7172
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
7273
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
7374
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
74-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
7575
STREAM_PUBLIC_BOT_TOKEN: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
7676

7777
update_develop_changelog:

build.gradle.kts

Lines changed: 91 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import com.android.build.api.dsl.ApplicationExtension
22
import com.android.build.gradle.LibraryExtension
33
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
4+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
5+
import io.getstream.chat.android.Configuration
46
import io.getstream.chat.android.Dependencies
57
import io.getstream.chat.android.command.changelog.task.ChangelogReleaseSectionTask
68
import io.getstream.chat.android.command.release.task.ReleaseTask
@@ -37,9 +39,8 @@ plugins {
3739
id("io.getstream.chat.VersionPrintPlugin")
3840
alias(libs.plugins.gitversioner)
3941
alias(libs.plugins.gradle.versions)
40-
alias(libs.plugins.nexus.publish)
4142
alias(libs.plugins.binary.compatibility.validator)
42-
alias(libs.plugins.dokka)
43+
alias(libs.plugins.maven.publish)
4344
}
4445

4546
buildscript {
@@ -133,4 +134,91 @@ apiValidation {
133134
)
134135
}
135136

136-
apply(from = "${rootDir}/scripts/publish-root.gradle")
137+
private val isSnapshot = System.getenv("SNAPSHOT")?.toBoolean() == true
138+
version = if (isSnapshot) Configuration.snapshotVersionName else Configuration.versionName
139+
140+
subprojects {
141+
plugins.withId("com.vanniktech.maven.publish") {
142+
extensions.configure<MavenPublishBaseExtension> {
143+
publishToMavenCentral(automaticRelease = true)
144+
145+
pom {
146+
name.set(project.name)
147+
description.set("Stream Chat official Android SDK")
148+
url.set("https://github.com/getstream/stream-chat-android")
149+
150+
licenses {
151+
license {
152+
name.set("Stream License")
153+
url.set("https://github.com/GetStream/stream-chat-android/blob/main/LICENSE")
154+
}
155+
}
156+
157+
developers {
158+
developer {
159+
id = "tschellenbach"
160+
name = "Thierry Schellenbach"
161+
162+
}
163+
developer {
164+
id = "jcminarro"
165+
name = "Jc Miñarro"
166+
167+
}
168+
developer {
169+
id = "samiuelson"
170+
name = "Samuel Urbanowicz"
171+
172+
}
173+
developer {
174+
id = "adasiewiczr"
175+
name = "Rafal Adasiewicz"
176+
177+
}
178+
developer {
179+
id = "ogkuzmin"
180+
name = "Oleg Kuzmin"
181+
182+
}
183+
developer {
184+
id = "zsmb13"
185+
name = "Márton Braun"
186+
187+
}
188+
developer {
189+
id = "leandroBorgesFerreira"
190+
name = "Leandro Borges Ferreira"
191+
192+
}
193+
developer {
194+
id = "bychkovdmitry"
195+
name = "Dmitrii Bychkov"
196+
197+
}
198+
}
199+
200+
scm {
201+
connection.set("scm:git:github.com/getstream/stream-chat-android.git")
202+
developerConnection.set("scm:git:ssh://github.com/getstream/stream-chat-android.git")
203+
url.set("https://github.com/getstream/stream-chat-android/tree/main")
204+
}
205+
}
206+
}
207+
}
208+
}
209+
210+
tasks.register("printAllArtifacts") {
211+
group = "publishing"
212+
description = "Prints all artifacts that will be published"
213+
214+
doLast {
215+
subprojects.forEach { subproject ->
216+
subproject.plugins.withId("com.vanniktech.maven.publish") {
217+
subproject.extensions.findByType(PublishingExtension::class.java)
218+
?.publications
219+
?.filterIsInstance<MavenPublication>()
220+
?.forEach { println("${it.groupId}:${it.artifactId}:${it.version}") }
221+
}
222+
}
223+
}
224+
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ firebaseCrashlyticsPlugin = "3.0.2"
4747
firebaseMessaging = "24.1.0"
4848
gitversioner = "0.5.0"
4949
googleServices = "4.4.2"
50-
gradleNexusPublishPlugin = "1.3.0"
5150
gradleVersionsPlugin = "0.51.0"
5251
huaweiPush = "6.11.0.300"
5352
ituDateVersion = "1.10.2"
@@ -93,6 +92,7 @@ turbine = "1.2.0"
9392
work = "2.9.1"
9493
playServicesLocation = "21.3.0"
9594
kover = "0.9.2"
95+
mavenPublish = "0.34.0"
9696

9797
[libraries]
9898
allure-kotlin-model = { module = "io.qameta.allure:allure-kotlin-model", version.ref = "allureKotlin"}
@@ -245,7 +245,7 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin"}
245245
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin"}
246246
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin"}
247247
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp"}
248-
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradleNexusPublishPlugin"}
248+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish"}
249249
shot = { id = "shot", version.ref = "shot"}
250250
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube"}
251251
spotless = { id = "com.diffplug.spotless", version.ref = "spotless"}

scripts/publish-module.gradle

Lines changed: 0 additions & 121 deletions
This file was deleted.

scripts/publish-root.gradle

Lines changed: 0 additions & 71 deletions
This file was deleted.

stream-chat-android-ai-assistant/build.gradle.kts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1+
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
12
import io.getstream.chat.android.Configuration
23
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
34

45
plugins {
56
alias(libs.plugins.stream.android.library)
67
alias(libs.plugins.kotlin.android)
78
alias(libs.plugins.kotlin.compose)
9+
alias(libs.plugins.maven.publish)
810
}
911

10-
rootProject.extra.apply {
11-
set("PUBLISH_GROUP_ID", Configuration.artifactGroup)
12-
set("PUBLISH_ARTIFACT_ID", "stream-chat-android-ai-assistant")
13-
set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName"))
14-
}
15-
16-
apply(from = "$rootDir/scripts/publish-module.gradle")
1712
apply(from = "$rootDir/scripts/detekt-compose.gradle")
1813

1914
android {
@@ -53,3 +48,18 @@ dependencies {
5348

5449
detektPlugins(libs.detekt.formatting)
5550
}
51+
52+
mavenPublishing {
53+
coordinates(
54+
groupId = Configuration.artifactGroup,
55+
artifactId = "stream-chat-android-ai-assistant",
56+
version = rootProject.version.toString(),
57+
)
58+
configure(
59+
AndroidSingleVariantLibrary(
60+
variant = "release",
61+
sourcesJar = true,
62+
publishJavadocJar = true,
63+
),
64+
)
65+
}

0 commit comments

Comments
 (0)