Skip to content

Commit f90e816

Browse files
RUM-10224: Generate list of published artifacts dynamically
1 parent 8ebdddc commit f90e816

File tree

2 files changed

+28
-31
lines changed

2 files changed

+28
-31
lines changed

build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,21 @@ tasks.register("printSdkDebugRuntimeClasspath") {
223223
File("sdk_classpath").writeText(result.joinToString(File.pathSeparator) { it.absolutePath })
224224
}
225225
}
226+
227+
tasks.register("listAllPublishedArtifactIds") {
228+
doLast {
229+
val artifactIds = rootProject.subprojects.flatMap { subproject ->
230+
val publishing = subproject.extensions.findByName("publishing") as? PublishingExtension
231+
publishing?.publications?.mapNotNull { publication ->
232+
if (publication is MavenPublication) {
233+
publication.artifactId
234+
} else {
235+
null
236+
}
237+
}.orEmpty()
238+
}
239+
artifactIds.forEach {
240+
println(it)
241+
}
242+
}
243+
}

ci/scripts/check_latest_release_is_published.sh

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,18 @@ tag_name=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
1111
-H "Accept: application/vnd.github+json" \
1212
https://api.github.com/repos/DataDog/dd-sdk-android/releases/latest | jq -r .tag_name)
1313

14-
repos_list=(
15-
"dd-sdk-android-core"
16-
"dd-sdk-android-internal"
17-
"dd-sdk-android-rum"
18-
"dd-sdk-android-logs"
19-
"dd-sdk-android-trace"
20-
"dd-sdk-android-trace-otel"
21-
"dd-sdk-android-webview"
22-
"dd-sdk-android-session-replay"
23-
"dd-sdk-android-session-replay-compose"
24-
"dd-sdk-android-session-replay-material"
25-
"dd-sdk-android-ndk"
26-
"dd-sdk-android-coil"
27-
"dd-sdk-android-compose"
28-
"dd-sdk-android-glide"
29-
"dd-sdk-android-okhttp"
30-
"dd-sdk-android-okhttp-otel"
31-
"dd-sdk-android-rum-coroutines"
32-
"dd-sdk-android-rx"
33-
"dd-sdk-android-sqldelight"
34-
"dd-sdk-android-timber"
35-
"dd-sdk-android-trace-coroutines"
36-
"dd-sdk-android-tv"
37-
"dd-sdk-android-fresco"
38-
)
39-
40-
for repo in "${repos_list[@]}"; do
41-
status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://repo1.maven.org/maven2/com/datadoghq/$repo/$tag_name/$repo-$tag_name.aar")
14+
for artifactId in $(./gradlew -q listAllPublishedArtifactIds); do
15+
status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://repo1.maven.org/maven2/com/datadoghq/$artifactId/$tag_name/$artifactId-$tag_name.aar")
4216

4317
if [ $status_code -eq 200 ]; then
44-
echo "Release $tag_name exists for $repo"
18+
echo "Release $tag_name exists for $artifactId"
4519
else
46-
echo "Release $tag_name doesn't exist for $repo"
47-
exit 1
20+
echo "Release $tag_name doesn't exist for $artifactId"
21+
# TODO remove this check when
22+
# https://github.com/DataDog/dd-sdk-android/commit/ccd79322895a6ba135e2b73b32005fb4aeb5c31c
23+
# is released
24+
if [ $artifactId != "dd-sdk-android-benchmark-internal" ]; then
25+
exit 1
26+
fi
4827
fi
4928
done

0 commit comments

Comments
 (0)