File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 2525 - name : Setup Gradle
2626 uses : gradle/actions/setup-gradle@v3
2727 - name : Build
28- run : ./gradlew --no-configuration-cache --no-parallel publish "-PsonatypeUsername=$SONATYPE_USERNAME" "-PsonatypePassword=$SONATYPE_PASSWORD"
28+ run : ./gradlew --no-configuration-cache --no-parallel mavenCentralDeploy "-PsonatypeUsername=$SONATYPE_USERNAME" "-PsonatypePassword=$SONATYPE_PASSWORD"
2929 env :
3030 SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
3131 SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
Original file line number Diff line number Diff line change @@ -49,3 +49,16 @@ val testAll by tasks.registering(DefaultTask::class) {
4949 this @registering.dependsOn(it)
5050 }
5151}
52+
53+ val mavenCentralDeploy by tasks.registering(DefaultTask ::class ) {
54+ group = " publishing"
55+ val isSnapshot = project.version.toString().endsWith(" -SNAPSHOT" )
56+
57+ val publishTasks = subprojects
58+ .flatMap { it.tasks.withType<PublishToMavenRepository >() }
59+ .filter { it.repository.name == " sonatype" }
60+ dependsOn(publishTasks)
61+ if (! isSnapshot) {
62+ dependsOn(tasks.closeAndReleaseStagingRepositories)
63+ }
64+ }
You can’t perform that action at this time.
0 commit comments