Skip to content

Commit 9c6e234

Browse files
authored
Added more logging (#427)
1 parent eedbf43 commit 9c6e234

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
java-version: 8
9898

9999
- name: Build and release
100-
run: ./gradlew githubRelease publishToSonatype closeAndReleaseStagingRepository
100+
run: ./gradlew githubRelease publishToSonatype closeAndReleaseStagingRepository releaseSummary
101101
env:
102102
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
103103
NEXUS_TOKEN_USER: ${{secrets.NEXUS_TOKEN_USER}}

build.gradle

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ allprojects {
2626
version = scmVersion.version
2727
}
2828

29+
println "Building version $version"
30+
2931
tasks.named("generateChangelog") {
3032
previousRevision = scmVersion.previousVersion
3133
githubToken = System.getenv("GITHUB_TOKEN")
@@ -59,13 +61,31 @@ nexusPublishing {
5961
}
6062
}
6163

62-
if (version.endsWith("-SNAPSHOT")) {
64+
def isSnapshot = version.endsWith("-SNAPSHOT")
65+
66+
if (isSnapshot) {
67+
println "Building a -SNAPSHOT version (Github release and Maven Central tasks are skipped)"
6368
tasks.named("githubRelease") {
64-
//snapshot versions do not produce changelog / GitHub releases
69+
//snapshot versions do not produce changelog / Github releases
6570
enabled = false
6671
}
6772
tasks.named("closeAndReleaseStagingRepository") {
6873
//snapshot binaries are available in Sonatype without the need to close the staging repo
6974
enabled = false
7075
}
76+
}
77+
78+
tasks.register("releaseSummary") {
79+
doLast {
80+
if (isSnapshot) {
81+
println "RELEASE SUMMARY\n" +
82+
" SNAPSHOTS released to: https://s01.oss.sonatype.org/content/repositories/snapshots/org/mockito/kotlin/mockito-kotlin\n" +
83+
" Release to Maven Central: SKIPPED FOR SNAPSHOTS\n" +
84+
" Github releases: SKIPPED FOR SNAPSHOTS"
85+
} else {
86+
println "RELEASE SUMMARY\n" +
87+
" Release to Maven Central (available after delay): https://repo1.maven.org/maven2/org/mockito/kotlin/mockito-kotlin/\n" +
88+
" Github releases: https://github.com/mockito/mockito-kotlin/releases"
89+
}
90+
}
7191
}

0 commit comments

Comments
 (0)