Skip to content

Commit 0824398

Browse files
authored
Migrate to Sonatype Central Portal (#5989)
* Migrate to Sonatype Central Portal * Update developers list
1 parent 4358665 commit 0824398

File tree

17 files changed

+281
-312
lines changed

17 files changed

+281
-312
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,22 @@ jobs:
5858
5959
publish:
6060
needs: generate_release_notes
61-
uses: GetStream/android-ci-actions/.github/workflows/release-new-version.yml@v0.1
61+
uses: GetStream/android-ci-actions/.github/workflows/release-new-version.yml@main
6262
with:
6363
ref: "release"
6464
bump: ${{ inputs.bump }}
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
69+
# Disable explicit documentation tasks as they are already included while publishing
70+
documentation-tasks: tasks
6871
secrets:
6972
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
7073
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
7174
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
7275
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
7376
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
74-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
7577
STREAM_PUBLIC_BOT_TOKEN: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
7678

7779
update_develop_changelog:
@@ -100,4 +102,4 @@ jobs:
100102
with:
101103
github_token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
102104
branch: develop
103-
force: true
105+
force: true

.github/workflows/publish-snapshot.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,15 @@ jobs:
1414
- name: Check out code
1515
uses: actions/[email protected]
1616
- uses: GetStream/android-ci-actions/actions/setup-java@main
17-
- name: Release build
18-
# assembleRelease for all modules, excluding non-library modules: samples, docs
19-
run: ./gradlew assembleRelease -x :stream-chat-android-ui-components-sample:assembleRelease -x :stream-chat-android-compose-sample:assembleRelease -x :stream-chat-android-docs:assembleRelease
20-
- name: Source jar and dokka
21-
run: ./gradlew androidSourcesJar javadocJar
2217
- name: Publish to MavenCentral
23-
run: ./gradlew publishReleasePublicationToSonatypeRepository
18+
run: ./gradlew publishToMavenCentral
2419
env:
25-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
26-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
27-
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
28-
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
29-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
30-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
20+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
21+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
22+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
23+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
24+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
25+
ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: true
3126
SNAPSHOT: true
3227
- name: Show snapshot version
3328
run: ./scripts/show-last-snapshot-update.sh

build.gradle.kts

Lines changed: 81 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,81 @@ 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 = "aleksandar-apostolov"
160+
name = "Aleksandar Apostolov"
161+
162+
}
163+
developer {
164+
id = "VelikovPetar"
165+
name = "Petar Velikov"
166+
167+
}
168+
developer {
169+
id = "andremion"
170+
name = "André Mion"
171+
172+
}
173+
developer {
174+
id = "rahul-lohra"
175+
name = "Rahul Kumar Lohra"
176+
177+
}
178+
developer {
179+
id = "PratimMallick"
180+
name = "Pratim Mallick"
181+
182+
}
183+
developer {
184+
id = "gpunto"
185+
name = "Gianmarco David"
186+
187+
}
188+
}
189+
190+
scm {
191+
connection.set("scm:git:github.com/getstream/stream-chat-android.git")
192+
developerConnection.set("scm:git:ssh://github.com/getstream/stream-chat-android.git")
193+
url.set("https://github.com/getstream/stream-chat-android/tree/main")
194+
}
195+
}
196+
}
197+
}
198+
}
199+
200+
tasks.register("printAllArtifacts") {
201+
group = "publishing"
202+
description = "Prints all artifacts that will be published"
203+
204+
doLast {
205+
subprojects.forEach { subproject ->
206+
subproject.plugins.withId("com.vanniktech.maven.publish") {
207+
subproject.extensions.findByType(PublishingExtension::class.java)
208+
?.publications
209+
?.filterIsInstance<MavenPublication>()
210+
?.forEach { println("${it.groupId}:${it.artifactId}:${it.version}") }
211+
}
212+
}
213+
}
214+
}

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.

0 commit comments

Comments
 (0)