Skip to content

Commit da7230a

Browse files
authored
Configure publishing through convention plugins (#6129)
1 parent 1cc0925 commit da7230a

61 files changed

Lines changed: 94 additions & 1122 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 21 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -4,104 +4,39 @@ on:
44
workflow_dispatch:
55
inputs:
66
bump:
7+
required: true
78
type: choice
89
description: "Type of version bump to perform"
910
options:
1011
- patch
1112
- minor
1213
- major
14+
default: minor
15+
16+
concurrency:
17+
group: release
18+
cancel-in-progress: false
1319

1420
jobs:
15-
generate_release_notes:
16-
name: Generate Release Notes
21+
pre_release_check:
22+
name: Pre release check
1723
runs-on: ubuntu-24.04
1824
environment: 'publish'
19-
outputs:
20-
release_notes: ${{ steps.update_release_notes.outputs.release_notes }}
2125
steps:
22-
- name: Check out code
23-
uses: actions/checkout@v4.2.2
24-
with:
25-
persist-credentials: false
26-
27-
# Bump the version using our custom action
28-
- uses: GetStream/android-ci-actions/actions/bump-version@v0.1
29-
id: bump-version
30-
with:
31-
bump: ${{ inputs.bump }}
32-
file-path: ./buildSrc/src/main/kotlin/io/getstream/chat/android/Configuration.kt
33-
34-
- name: Parse release section in changelog
35-
run: ./gradlew changelog-release-section
36-
37-
- name: Commit changes
38-
uses: EndBug/add-and-commit@v9.1.4
39-
with:
40-
add: '["CHANGELOG.md"]'
41-
message: "AUTOMATION: CHANGELOG Update"
42-
default_author: github_actions
43-
push: false
44-
- name: Push changes
45-
uses: ad-m/github-push-action@v0.8.0
46-
with:
47-
github_token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
48-
branch: release
49-
force: true
50-
51-
- name: Update release notes
52-
id: update_release_notes
53-
run: |
54-
./gradlew generate-release
55-
{
56-
echo "release_notes<<EOF"
57-
cat build/tmp/CHANGELOG_PARSED.md
58-
echo "EOF"
59-
} >> "$GITHUB_OUTPUT"
60-
26+
- name: Check
27+
id: pre_release_check_step
28+
run: echo "Pre release check"
6129
publish:
62-
needs: generate_release_notes
63-
uses: GetStream/android-ci-actions/.github/workflows/release-new-version.yml@main
30+
permissions:
31+
contents: write
32+
needs: pre_release_check
33+
uses: GetStream/stream-build-conventions-android/.github/workflows/release.yml@v0.8.0
6434
with:
65-
ref: "release"
6635
bump: ${{ inputs.bump }}
67-
file-path: ./buildSrc/src/main/kotlin/io/getstream/chat/android/Configuration.kt
68-
release-notes: ${{ needs.generate_release_notes.outputs.release_notes }}
69-
excluded-modules: "stream-chat-android-ui-components-sample,stream-chat-android-compose-sample,stream-chat-android-docs"
70-
use-official-plugin: false
71-
# Disable explicit documentation tasks as they are already included while publishing
72-
documentation-tasks: tasks
7336
secrets:
74-
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
75-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
76-
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
77-
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
78-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
79-
STREAM_PUBLIC_BOT_TOKEN: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
80-
81-
update_develop_changelog:
82-
needs: publish
83-
runs-on: ubuntu-24.04
84-
steps:
85-
- name: Check out code
86-
uses: actions/checkout@v4.2.2
87-
with:
88-
ref: develop
89-
persist-credentials: false
90-
91-
- name: Update changelog
92-
run: cat CHANGELOG_MODEL.md CHANGELOG.md > newChangelog.md && mv newChangelog.md CHANGELOG.md
93-
94-
- name: Commit changes
95-
uses: EndBug/add-and-commit@v9.1.4
96-
with:
97-
add: '["CHANGELOG.md"]'
98-
message: "AUTOMATION: CHANGELOG Update"
99-
default_author: github_actions
100-
push: false
101-
102-
- name: Push changes
103-
uses: ad-m/github-push-action@v0.8.0
104-
with:
105-
github_token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
106-
branch: develop
107-
force: true
37+
github-token: ${{ secrets.STREAM_PUBLIC_BOT_TOKEN }}
38+
maven-central-username: ${{ secrets.OSSRH_USERNAME }}
39+
maven-central-password: ${{ secrets.OSSRH_PASSWORD }}
40+
signing-key: ${{ secrets.SIGNING_KEY }}
41+
signing-key-id: ${{ secrets.SIGNING_KEY_ID }}
42+
signing-key-password: ${{ secrets.SIGNING_PASSWORD }}

.github/workflows/release-docs.yaml

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

.idea/codeStyles/Project.xml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 13 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
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
6-
import io.getstream.chat.android.Dependencies
7-
import io.getstream.chat.android.command.changelog.task.ChangelogReleaseSectionTask
8-
import io.getstream.chat.android.command.release.task.ReleaseTask
94

105
plugins {
116
alias(libs.plugins.android.application) apply false
@@ -27,13 +22,9 @@ plugins {
2722
alias(libs.plugins.detekt) apply false
2823
alias(libs.plugins.shot) apply false
2924
alias(libs.plugins.androidx.navigation) apply false
30-
id("io.getstream.chat.ReleasePlugin")
31-
id("io.getstream.chat.ChangelogReleaseSectionPlugin")
3225
alias(libs.plugins.gitversioner)
3326
alias(libs.plugins.gradle.versions)
3427
alias(libs.plugins.binary.compatibility.validator)
35-
alias(libs.plugins.dokka)
36-
alias(libs.plugins.maven.publish)
3728
}
3829

3930
streamProject {
@@ -53,6 +44,15 @@ streamProject {
5344
"stream-chat-android-ui-utils",
5445
)
5546
}
47+
48+
publishing {
49+
description = "Stream Chat official Android SDK"
50+
ignoredModules = setOf(
51+
"stream-chat-android-client-test",
52+
"stream-chat-android-e2e-test",
53+
"stream-chat-android-test",
54+
)
55+
}
5656
}
5757

5858
afterEvaluate {
@@ -102,19 +102,14 @@ subprojects {
102102
}
103103

104104
tasks.withType<DependencyUpdatesTask> {
105+
fun isStable(version: String): Boolean = ("^[0-9.-]+$").toRegex().matches(version)
106+
fun isNonStable(version: String): Boolean = isStable(version).not()
107+
105108
rejectVersionIf {
106-
Dependencies.isStable(currentVersion) && Dependencies.isNonStable(candidate.version)
109+
isStable(currentVersion) && isNonStable(candidate.version)
107110
}
108111
}
109112

110-
tasks.withType<ReleaseTask> {
111-
config.changelogPath = "CHANGELOG.md"
112-
}
113-
114-
tasks.withType<ChangelogReleaseSectionTask> {
115-
config.changelogPath = "CHANGELOG.md"
116-
}
117-
118113
tasks.withType<Delete> {
119114
delete(rootProject.layout.buildDirectory)
120115
}
@@ -140,82 +135,3 @@ apiValidation {
140135
"io.getstream.chat.android.core.internal.InternalStreamChatApi",
141136
)
142137
}
143-
144-
private val isSnapshot = System.getenv("SNAPSHOT")?.toBoolean() == true
145-
version = if (isSnapshot) Configuration.snapshotVersionName else Configuration.versionName
146-
147-
subprojects {
148-
plugins.withId("com.vanniktech.maven.publish") {
149-
extensions.configure<MavenPublishBaseExtension> {
150-
publishToMavenCentral(automaticRelease = true)
151-
152-
pom {
153-
name.set(project.name)
154-
description.set("Stream Chat official Android SDK")
155-
url.set("https://github.com/getstream/stream-chat-android")
156-
157-
licenses {
158-
license {
159-
name.set("Stream License")
160-
url.set("https://github.com/GetStream/stream-chat-android/blob/main/LICENSE")
161-
}
162-
}
163-
164-
developers {
165-
developer {
166-
id = "aleksandar-apostolov"
167-
name = "Aleksandar Apostolov"
168-
email = "aleksandar.apostolov@getstream.io"
169-
}
170-
developer {
171-
id = "VelikovPetar"
172-
name = "Petar Velikov"
173-
email = "petar.velikov@getstream.io"
174-
}
175-
developer {
176-
id = "andremion"
177-
name = "André Mion"
178-
email = "andre.rego@getstream.io"
179-
}
180-
developer {
181-
id = "rahul-lohra"
182-
name = "Rahul Kumar Lohra"
183-
email = "rahul.lohra@getstream.io"
184-
}
185-
developer {
186-
id = "PratimMallick"
187-
name = "Pratim Mallick"
188-
email = "pratim.mallick@getstream.io"
189-
}
190-
developer {
191-
id = "gpunto"
192-
name = "Gianmarco David"
193-
email = "gianmarco.david@getstream.io"
194-
}
195-
}
196-
197-
scm {
198-
connection.set("scm:git:github.com/getstream/stream-chat-android.git")
199-
developerConnection.set("scm:git:ssh://github.com/getstream/stream-chat-android.git")
200-
url.set("https://github.com/getstream/stream-chat-android/tree/main")
201-
}
202-
}
203-
}
204-
}
205-
}
206-
207-
tasks.register("printAllArtifacts") {
208-
group = "publishing"
209-
description = "Prints all artifacts that will be published"
210-
211-
doLast {
212-
subprojects.forEach { subproject ->
213-
subproject.plugins.withId("com.vanniktech.maven.publish") {
214-
subproject.extensions.findByType(PublishingExtension::class.java)
215-
?.publications
216-
?.filterIsInstance<MavenPublication>()
217-
?.forEach { println("${it.groupId}:${it.artifactId}:${it.version}") }
218-
}
219-
}
220-
}
221-
}

buildSrc/build.gradle.kts

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

buildSrc/src/main/kotlin/io/getstream/chat/android/Configuration.kt

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

buildSrc/src/main/kotlin/io/getstream/chat/android/Dependencies.kt

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

0 commit comments

Comments
 (0)