1buildscript { 2 repositories { 3 mavenLocal() // for local testing 4 maven { url "https://plugins.gradle.org/m2/" } 5 } 6 dependencies { 7 classpath "org.shipkit:shipkit-changelog:1.+" 8 classpath "org.shipkit:shipkit-auto-version:1.+" 9 } 10} 11 12plugins { 13 id "io.github.gradle-nexus.publish-plugin" version "1.0.0" 14} 15 16apply plugin: "org.shipkit.shipkit-auto-version" 17apply plugin: "org.shipkit.shipkit-changelog" 18apply plugin: "org.shipkit.shipkit-github-release" 19 20allprojects { 21 group = 'org.mockito.kotlin' 22} 23 24tasks.named("generateChangelog") { 25 previousRevision = project.ext.'shipkit-auto-version.previous-tag' 26 githubToken = System.getenv("GITHUB_TOKEN") 27 repository = "mockito/mockito-kotlin" 28 releaseTag = project.version 29} 30 31tasks.named("githubRelease") { 32 def genTask = tasks.named("generateChangelog").get() 33 dependsOn genTask 34 repository = genTask.repository 35 changelog = genTask.outputFile 36 githubToken = System.getenv("GITHUB_TOKEN") 37 newTagRevision = System.getenv("GITHUB_SHA") 38 releaseTag = project.version 39 releaseName = project.version 40} 41 42nexusPublishing { 43 repositories { 44 if (System.getenv("NEXUS_TOKEN_PWD")) { 45 sonatype { // Publishing to: https://s01.oss.sonatype.org (faster instance) 46 nexusUrl = uri("https://s01.oss.sonatype.org/service/local/") 47 snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") 48 49 username = System.getenv("NEXUS_TOKEN_USER") 50 password = System.getenv("NEXUS_TOKEN_PWD") 51 } 52 } 53 } 54} 55