Skip to content

Commit 42ee2c4

Browse files
committed
ci: update release scripts
1 parent f9858d7 commit 42ee2c4

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

buildSrc/src/main/kotlin/flamingock.release-management.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ if (isReleasing && projectsToRelease.contains(project.name)) {
148148
}
149149
}
150150

151+
// Defensive gate against unqualified `./gradlew jreleaserDeploy` fan-out. The org.jreleaser
152+
// plugin is applied to every subproject that consumes this convention plugin, so every one of
153+
// them registers a jreleaserDeploy task. Without this onlyIf, Gradle 8.5's strict input
154+
// validation fails the task on subprojects whose build/jreleaser directory was never primed
155+
// (e.g. flamingock-gradle-plugin, which is published via publishPlugins and has no deploy
156+
// config). Skipping cleanly preserves the script-level qualification fix as belt-and-suspenders.
157+
tasks.matching { it.name == "jreleaserDeploy" }.configureEach {
158+
onlyIf("project not in projectsToRelease") {
159+
project == rootProject || projectsToRelease.contains(project.name)
160+
}
161+
}
162+
151163
// Utility functions
152164
fun Project.getIfAlreadyReleasedFromCentralPortal(): Boolean {
153165
val mavenUsername: String? = System.getenv("JRELEASER_MAVENCENTRAL_USERNAME")

infra/bundle-release-with-retry.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ validate_bundle "$1"
2020

2121
echo "Releasing bundle[$1] to Central Portal with max attempts[$maxAttempts] and $waitingSeconds seconds delay"
2222
for (( i=1; i<=maxAttempts; i++ )); do
23-
if ./gradlew jreleaserFullRelease -Pmodule="$1" --no-daemon --stacktrace; then
23+
# A bundle spans multiple projects, so we deliberately use the unqualified task name and
24+
# let the release-management convention plugin's projectsToRelease (driven by -PreleaseBundle)
25+
# decide which projects participate. The onlyIf gate inside that plugin skips projects
26+
# outside the bundle cleanly, so the unqualified fan-out is safe.
27+
if ./gradlew jreleaserFullRelease -PreleaseBundle="$1" --no-daemon --stacktrace; then
2428
exit 0
2529
fi
2630
if [ "$i" -eq "$maxAttempts" ]; then

infra/module-release-with-retry.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ else
1313
MODULE_FLAG=""
1414
echo "Releasing bundle to Central Portal with max attempts[$maxAttempts] and $waitingSeconds seconds delay"
1515
fi
16+
# The unqualified jreleaserDeploy fans out to every subproject that has the org.jreleaser
17+
# plugin applied (it's applied broadly by flamingock.release-management). The release-management
18+
# convention plugin's onlyIf gate skips projects outside projectsToRelease so the fan-out is safe.
1619
for (( i=1; i<=maxAttempts; i++ )); do
1720
if ./gradlew jreleaserDeploy $MODULE_FLAG $extraFlags --no-daemon --stacktrace; then
1821
exit 0

0 commit comments

Comments
 (0)