diff options
author | Szczepan Faber <s.faber@airbnb.com> | 2021-03-13 16:17:32 -0600 |
---|---|---|
committer | Szczepan Faber <s.faber@airbnb.com> | 2021-03-13 19:26:51 -0600 |
commit | 147adc85bf34b613f0161ff15c302bbe29dbf964 (patch) | |
tree | 9895c8175b759a541abed60cae9555558e904f98 | |
parent | 7486edad8517a1a5c8834c3e44191725afab2ad9 (diff) | |
download | mockito-kotlin-147adc85bf34b613f0161ff15c302bbe29dbf964.tar.gz |
Automated releases
-rw-r--r-- | .github/workflows/ci.yml | 10 | ||||
-rw-r--r-- | RELEASING.md | 6 | ||||
-rw-r--r-- | build.gradle | 18 | ||||
-rw-r--r-- | gradle/publishing.gradle | 42 | ||||
-rw-r--r-- | mockito-kotlin/build.gradle | 1 |
5 files changed, 28 insertions, 49 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18a37f8..3dd06af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: - name: 3. Build with Kotlin ${{ matrix.kotlin }} and mock-maker ${{ matrix.mock-maker }} run: | ops/mockMakerInline.sh - ./gradlew build bintrayUpload -PbintrayDryRun + ./gradlew build env: KOTLIN_VERSION: ${{ matrix.kotlin }} MOCK_MAKER: ${{ matrix.mock-maker }} @@ -96,11 +96,11 @@ jobs: with: java-version: 8 - - name: Build and publish to Bintray/MavenCentral - run: ./gradlew githubRelease bintrayUpload + - name: Build and release + run: ./gradlew githubRelease publishToSonatype # closeAndReleaseStagingRepository env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - BINTRAY_API_KEY: ${{secrets.BINTRAY_API_KEY}} NEXUS_TOKEN_USER: ${{secrets.NEXUS_TOKEN_USER}} NEXUS_TOKEN_PWD: ${{secrets.NEXUS_TOKEN_PWD}} - + PGP_KEY: ${{secrets.PGP_KEY}} + PGP_PWD: ${{secrets.PGP_PWD}} diff --git a/RELEASING.md b/RELEASING.md index f1eb2d6..3f0140c 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,5 +1,3 @@ -To publish a release: +# Releasing - - Tag the commit on master: `git tag -a x.x.x -m x.x.x && git push --tags` - - Execute the release process: `./gradlew clean test bintraySign mavenCentralSync -PisRelease=true` - - Don't forget to publish the tag on Github with release notes :)
\ No newline at end of file +Every change on the main development branch is released to Maven Central.
\ No newline at end of file diff --git a/build.gradle b/build.gradle index 3a07a83..8d74f9b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,13 @@ plugins { id "org.shipkit.shipkit-auto-version" version "1.1.1" - id "org.shipkit.shipkit-changelog" version "1.1.1" - id "org.shipkit.shipkit-github-release" version "1.1.1" + id "org.shipkit.shipkit-changelog" version "1.1.10" + id "org.shipkit.shipkit-github-release" version "1.1.10" + id "io.github.gradle-nexus.publish-plugin" version "1.0.0" } +//TODO: change java packages to "org.mockito.kotlin" +group = 'org.mockito.kotlin' + tasks.named("generateChangelog") { previousRevision = project.ext.'shipkit-auto-version.previous-tag' githubToken = System.getenv("GITHUB_TOKEN") @@ -19,3 +23,13 @@ tasks.named("githubRelease") { newTagRevision = System.getenv("GITHUB_SHA") } +nexusPublishing { + repositories { + if (System.getenv("NEXUS_TOKEN_PWD")) { + sonatype { + username = System.getenv("NEXUS_TOKEN_USER") + password = System.getenv("NEXUS_TOKEN_PWD") + } + } + } +} diff --git a/gradle/publishing.gradle b/gradle/publishing.gradle index 722f59a..6bb5f1a 100644 --- a/gradle/publishing.gradle +++ b/gradle/publishing.gradle @@ -1,8 +1,5 @@ apply plugin: 'maven-publish' -//TODO: update the group to 'org.mockito' ***AND*** change java packages -group = 'com.nhaarman.mockitokotlin2' - task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from 'build/javadoc' @@ -63,39 +60,10 @@ tasks.withType(GenerateModuleMetadata) { //fleshes out problems with Maven pom generation when building tasks.build.dependsOn('publishJavaLibraryPublicationToMavenLocal') -//Bintray Gradle plugin configuration (https://github.com/bintray/gradle-bintray-plugin) -//Plugin jars are added to the buildscript classpath in the root build.gradle file -apply plugin: 'com.jfrog.bintray' - -bintray { - //We need to use some user id here, because the Bintray key is associated with the user - //However, any user id is good, so longer the user has necessary privileges to the repository - user = 'szczepiq' //https://bintray.com/szczepiq - key = System.getenv('BINTRAY_API_KEY') - publish = false //can be changed to 'false' for testing - dryRun = project.hasProperty('bintrayDryRun') - - publications = ['javaLibrary'] - - pkg { - repo = 'test' //https://bintray.com/mockito/maven // TODO change to 'maaven' when CI ready - userOrg = 'mockito' //https://bintray.com/mockito - - name = 'mockito-kotlin' - - licenses = ['MIT'] - labels = ['kotlin', 'mockito'] - vcsUrl = 'https://github.com/mockito/mockito-kotlin.git' - - version { - name = project.version - vcsTag = "v$project.version" - - mavenCentralSync { - sync = false // TODO enable after CI+bintray integration is ready - user = System.getenv('NEXUS_TOKEN_USER') - password = System.getenv('NEXUS_TOKEN_PWD') - } - } +apply plugin: 'signing' //https://docs.gradle.org/current/userguide/signing_plugin.html +signing { + if (System.getenv("PGP_KEY")) { + useInMemoryPgpKeys(System.getenv("PGP_KEY"), System.getenv("PGP_PWD")) + sign publishing.publications.javaLibrary } }
\ No newline at end of file diff --git a/mockito-kotlin/build.gradle b/mockito-kotlin/build.gradle index 0e44297..6c726db 100644 --- a/mockito-kotlin/build.gradle +++ b/mockito-kotlin/build.gradle @@ -13,7 +13,6 @@ buildscript { dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17" - classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5" } } |