Skip to content

Commit 8440fee

Browse files
committed
Migrate to Sonatype Central Portal
1 parent 0135410 commit 8440fee

File tree

12 files changed

+221
-249
lines changed

12 files changed

+221
-249
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
bump: ${{ inputs.bump }}
2929
file-path: ./buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt
3030
excluded-modules: "demo-app,tutorials:tutorial-video,tutorials:tutorial-audio"
31+
use-official-plugin: false
3132
secrets:
3233
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
3334
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
3435
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
3536
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
3637
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
37-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
3838
STREAM_PUBLIC_BOT_TOKEN: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}

build.gradle.kts

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
apply(plugin = "io.github.gradle-nexus.publish-plugin")
2-
apply(plugin = "org.jetbrains.dokka")
1+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
2+
import io.getstream.video.android.Configuration
3+
34
apply(from = "${rootDir}/scripts/open-api-code-gen.gradle.kts")
45

56
buildscript {
@@ -29,7 +30,7 @@ plugins {
2930
alias(libs.plugins.kotlin.compatibility.validator) apply false
3031
alias(libs.plugins.ksp) apply false
3132
alias(libs.plugins.wire) apply false
32-
alias(libs.plugins.nexus) apply false
33+
alias(libs.plugins.maven.publish)
3334
alias(libs.plugins.google.gms) apply false
3435
alias(libs.plugins.dokka) apply false
3536
alias(libs.plugins.spotless) apply false
@@ -69,7 +70,100 @@ tasks.register("clean")
6970
delete(rootProject.buildDir)
7071
}
7172

72-
apply(from = "${rootDir}/scripts/publish-root.gradle")
73+
private val isSnapshot = System.getenv("SNAPSHOT")?.toBoolean() == true
74+
version = if (isSnapshot) Configuration.snapshotVersionName else Configuration.versionName
75+
76+
subprojects {
77+
plugins.withId("com.vanniktech.maven.publish") {
78+
extensions.configure<MavenPublishBaseExtension> {
79+
publishToMavenCentral(automaticRelease = true)
80+
81+
pom {
82+
name.set(project.name)
83+
description.set("Stream Video official Android SDK")
84+
url.set("https://github.com/getstream/stream-video-android")
85+
86+
licenses {
87+
license {
88+
name.set("Stream License")
89+
url.set("https://github.com/GetStream/stream-video-android/blob/main/LICENSE")
90+
}
91+
}
92+
93+
developers {
94+
developer {
95+
id = "aleksandar-apostolov"
96+
name = "Aleksandar Apostolov"
97+
98+
}
99+
developer {
100+
id = "VelikovPetar"
101+
name = "Petar Velikov"
102+
103+
}
104+
developer {
105+
id = "andremion"
106+
name = "André Mion"
107+
108+
}
109+
developer {
110+
id = "rahul-lohra"
111+
name = "Rahul Kumar Lohra"
112+
113+
}
114+
developer {
115+
id = "gpunto"
116+
name = "Gianmarco David"
117+
118+
}
119+
developer {
120+
id = "filbabic"
121+
name = "Filip Babic"
122+
123+
}
124+
developer {
125+
id = "skydoves"
126+
name = "Jaewoong Eum"
127+
128+
}
129+
developer {
130+
id = "kanat"
131+
name = "Kanat Kiialbaev"
132+
133+
}
134+
developer {
135+
id = "TGazica"
136+
name = "Tomislav Gazica"
137+
138+
}
139+
}
140+
141+
scm {
142+
connection.set("scm:git:github.com/getstream/stream-video-android.git")
143+
developerConnection.set("scm:git:ssh://github.com/getstream/stream-video-android.git")
144+
url.set("https://github.com/getstream/stream-video-android/tree/main")
145+
}
146+
}
147+
}
148+
}
149+
}
150+
151+
tasks.register("printAllArtifacts") {
152+
group = "publishing"
153+
description = "Prints all artifacts that will be published"
154+
155+
doLast {
156+
subprojects.forEach { subproject ->
157+
subproject.plugins.withId("com.vanniktech.maven.publish") {
158+
subproject.extensions.findByType(PublishingExtension::class.java)
159+
?.publications
160+
?.filterIsInstance<MavenPublication>()
161+
?.forEach { println("${it.groupId}:${it.artifactId}:${it.version}") }
162+
}
163+
}
164+
}
165+
}
166+
73167
//apply(from = teamPropsFile("git-hooks.gradle.kts"))
74168
//
75169
//fun teamPropsFile(propsFile: String): File {

gradle/libs.versions.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ cameraCamera2 = "1.3.4"
1010
kover = "0.8.3"
1111
sonarqube = "6.0.1.5171"
1212
spotless = "6.21.0"
13-
nexusPlugin = "1.3.0"
1413
streamConventions = "0.2.0"
14+
mavenPublish = "0.34.0"
1515
kotlin = "1.9.25"
1616
ksp = "1.9.25-1.0.20"
1717
kotlinSerialization = "1.6.3"
1818
kotlinSerializationConverter = "1.0.0"
1919
kotlinxCoroutines = "1.9.0"
2020
cameraCore = "1.4.2"
21-
2221
kotlinDokka = "1.9.20"
2322

2423
androidxMaterial = "1.12.0"
@@ -250,8 +249,8 @@ sonarqube = { id = "org.sonarqube", version.ref = "sonarqube"}
250249
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
251250
stream-android-application = { id = "io.getstream.android.application", version.ref = "streamConventions" }
252251
stream-android-library = { id = "io.getstream.android.library", version.ref = "streamConventions" }
252+
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish"}
253253
dokka = { id = "org.jetbrains.dokka", version.ref = "kotlinDokka" }
254-
nexus = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPlugin" }
255254
google-gms = { id = "com.google.gms.google-services", version.ref = "googleService" }
256255
wire = { id = "com.squareup.wire", version.ref = "wire" }
257256
paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazzi" }

scripts/publish-module.gradle

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

scripts/publish-root.gradle

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
import com.vanniktech.maven.publish.JavadocJar
2+
import com.vanniktech.maven.publish.KotlinJvm
13
import io.getstream.video.android.Configuration
24

35
plugins {
4-
kotlin("jvm")
5-
}
6-
7-
rootProject.extra.apply {
8-
set("PUBLISH_GROUP_ID", Configuration.artifactGroup)
9-
set("PUBLISH_ARTIFACT_ID", "stream-video-android-bom")
10-
set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName"))
6+
alias(libs.plugins.maven.publish)
7+
alias(libs.plugins.dokka)
8+
kotlin("jvm")
119
}
1210

1311
dependencies {
@@ -21,4 +19,16 @@ dependencies {
2119
}
2220
}
2321

24-
apply(from ="${rootDir}/scripts/publish-module.gradle")
22+
mavenPublishing {
23+
coordinates(
24+
groupId = Configuration.artifactGroup,
25+
artifactId = "stream-video-android-bom",
26+
version = rootProject.version.toString(),
27+
)
28+
configure(
29+
KotlinJvm(
30+
javadocJar = JavadocJar.Dokka("dokkaJavadoc"),
31+
sourcesJar = true,
32+
),
33+
)
34+
}

0 commit comments

Comments
 (0)