Skip to content

Commit 1ce2ec2

Browse files
committed
improve snapshot check
1 parent f7de3c9 commit 1ce2ec2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
PUBLISH_USER: ${{ secrets.PUBLISH_USER }}
107107
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
108108
run: |
109-
./gradlew publishToMavenCentral -Psnapshot --stacktrace
109+
./gradlew publishToMavenCentral -Psnapshot=true --stacktrace
110110
111111
sonar:
112112
needs: [test]

build.gradle.kts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ publishingCentral {
2525

2626
afterEvaluate {
2727
if (hasProperty("snapshot")) {
28-
tasks.named("publishAllReleasesToMavenCentral") {
29-
enabled = version.toString().endsWith("SNAPSHOT")
30-
if (!enabled) {
31-
logger.warn("skipping publishing because version is not a snapshot.")
32-
}
28+
val publish = tasks.findByName("publishAllReleasesToMavenCentral")
29+
publish?.enabled = version.toString().endsWith("SNAPSHOT")
30+
if (publish?.enabled == false) {
31+
logger.warn("skipping publishing because version is not a snapshot.")
3332
}
3433
}
3534
}

0 commit comments

Comments
 (0)