Skip to content

Commit

Permalink
Added more logging (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
mockitoguy authored Apr 1, 2021
1 parent eedbf43 commit 9c6e234
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
java-version: 8

- name: Build and release
run: ./gradlew githubRelease publishToSonatype closeAndReleaseStagingRepository
run: ./gradlew githubRelease publishToSonatype closeAndReleaseStagingRepository releaseSummary
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NEXUS_TOKEN_USER: ${{secrets.NEXUS_TOKEN_USER}}
Expand Down
24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ allprojects {
version = scmVersion.version
}

println "Building version $version"

tasks.named("generateChangelog") {
previousRevision = scmVersion.previousVersion
githubToken = System.getenv("GITHUB_TOKEN")
Expand Down Expand Up @@ -59,13 +61,31 @@ nexusPublishing {
}
}

if (version.endsWith("-SNAPSHOT")) {
def isSnapshot = version.endsWith("-SNAPSHOT")

if (isSnapshot) {
println "Building a -SNAPSHOT version (Github release and Maven Central tasks are skipped)"
tasks.named("githubRelease") {
//snapshot versions do not produce changelog / GitHub releases
//snapshot versions do not produce changelog / Github releases
enabled = false
}
tasks.named("closeAndReleaseStagingRepository") {
//snapshot binaries are available in Sonatype without the need to close the staging repo
enabled = false
}
}

tasks.register("releaseSummary") {
doLast {
if (isSnapshot) {
println "RELEASE SUMMARY\n" +
" SNAPSHOTS released to: https://s01.oss.sonatype.org/content/repositories/snapshots/org/mockito/kotlin/mockito-kotlin\n" +
" Release to Maven Central: SKIPPED FOR SNAPSHOTS\n" +
" Github releases: SKIPPED FOR SNAPSHOTS"
} else {
println "RELEASE SUMMARY\n" +
" Release to Maven Central (available after delay): https://repo1.maven.org/maven2/org/mockito/kotlin/mockito-kotlin/\n" +
" Github releases: https://github.com/mockito/mockito-kotlin/releases"
}
}
}

0 comments on commit 9c6e234

Please sign in to comment.