Skip to content

Commit 68237d0

Browse files
authored
Merge pull request #409 from mockito/sf
Automated releases
2 parents 7486eda + 147adc8 commit 68237d0

File tree

5 files changed

+28
-49
lines changed

5 files changed

+28
-49
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: 3. Build with Kotlin ${{ matrix.kotlin }} and mock-maker ${{ matrix.mock-maker }}
6868
run: |
6969
ops/mockMakerInline.sh
70-
./gradlew build bintrayUpload -PbintrayDryRun
70+
./gradlew build
7171
env:
7272
KOTLIN_VERSION: ${{ matrix.kotlin }}
7373
MOCK_MAKER: ${{ matrix.mock-maker }}
@@ -96,11 +96,11 @@ jobs:
9696
with:
9797
java-version: 8
9898

99-
- name: Build and publish to Bintray/MavenCentral
100-
run: ./gradlew githubRelease bintrayUpload
99+
- name: Build and release
100+
run: ./gradlew githubRelease publishToSonatype # closeAndReleaseStagingRepository
101101
env:
102102
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
103-
BINTRAY_API_KEY: ${{secrets.BINTRAY_API_KEY}}
104103
NEXUS_TOKEN_USER: ${{secrets.NEXUS_TOKEN_USER}}
105104
NEXUS_TOKEN_PWD: ${{secrets.NEXUS_TOKEN_PWD}}
106-
105+
PGP_KEY: ${{secrets.PGP_KEY}}
106+
PGP_PWD: ${{secrets.PGP_PWD}}

RELEASING.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
To publish a release:
1+
# Releasing
22

3-
- Tag the commit on master: `git tag -a x.x.x -m x.x.x && git push --tags`
4-
- Execute the release process: `./gradlew clean test bintraySign mavenCentralSync -PisRelease=true`
5-
- Don't forget to publish the tag on Github with release notes :)
3+
Every change on the main development branch is released to Maven Central.

build.gradle

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
plugins {
22
id "org.shipkit.shipkit-auto-version" version "1.1.1"
3-
id "org.shipkit.shipkit-changelog" version "1.1.1"
4-
id "org.shipkit.shipkit-github-release" version "1.1.1"
3+
id "org.shipkit.shipkit-changelog" version "1.1.10"
4+
id "org.shipkit.shipkit-github-release" version "1.1.10"
5+
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
56
}
67

8+
//TODO: change java packages to "org.mockito.kotlin"
9+
group = 'org.mockito.kotlin'
10+
711
tasks.named("generateChangelog") {
812
previousRevision = project.ext.'shipkit-auto-version.previous-tag'
913
githubToken = System.getenv("GITHUB_TOKEN")
@@ -19,3 +23,13 @@ tasks.named("githubRelease") {
1923
newTagRevision = System.getenv("GITHUB_SHA")
2024
}
2125

26+
nexusPublishing {
27+
repositories {
28+
if (System.getenv("NEXUS_TOKEN_PWD")) {
29+
sonatype {
30+
username = System.getenv("NEXUS_TOKEN_USER")
31+
password = System.getenv("NEXUS_TOKEN_PWD")
32+
}
33+
}
34+
}
35+
}

gradle/publishing.gradle

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
apply plugin: 'maven-publish'
22

3-
//TODO: update the group to 'org.mockito' ***AND*** change java packages
4-
group = 'com.nhaarman.mockitokotlin2'
5-
63
task javadocJar(type: Jar, dependsOn: javadoc) {
74
classifier = 'javadoc'
85
from 'build/javadoc'
@@ -63,39 +60,10 @@ tasks.withType(GenerateModuleMetadata) {
6360
//fleshes out problems with Maven pom generation when building
6461
tasks.build.dependsOn('publishJavaLibraryPublicationToMavenLocal')
6562

66-
//Bintray Gradle plugin configuration (https://github.com/bintray/gradle-bintray-plugin)
67-
//Plugin jars are added to the buildscript classpath in the root build.gradle file
68-
apply plugin: 'com.jfrog.bintray'
69-
70-
bintray {
71-
//We need to use some user id here, because the Bintray key is associated with the user
72-
//However, any user id is good, so longer the user has necessary privileges to the repository
73-
user = 'szczepiq' //https://bintray.com/szczepiq
74-
key = System.getenv('BINTRAY_API_KEY')
75-
publish = false //can be changed to 'false' for testing
76-
dryRun = project.hasProperty('bintrayDryRun')
77-
78-
publications = ['javaLibrary']
79-
80-
pkg {
81-
repo = 'test' //https://bintray.com/mockito/maven // TODO change to 'maaven' when CI ready
82-
userOrg = 'mockito' //https://bintray.com/mockito
83-
84-
name = 'mockito-kotlin'
85-
86-
licenses = ['MIT']
87-
labels = ['kotlin', 'mockito']
88-
vcsUrl = 'https://github.com/mockito/mockito-kotlin.git'
89-
90-
version {
91-
name = project.version
92-
vcsTag = "v$project.version"
93-
94-
mavenCentralSync {
95-
sync = false // TODO enable after CI+bintray integration is ready
96-
user = System.getenv('NEXUS_TOKEN_USER')
97-
password = System.getenv('NEXUS_TOKEN_PWD')
98-
}
99-
}
63+
apply plugin: 'signing' //https://docs.gradle.org/current/userguide/signing_plugin.html
64+
signing {
65+
if (System.getenv("PGP_KEY")) {
66+
useInMemoryPgpKeys(System.getenv("PGP_KEY"), System.getenv("PGP_PWD"))
67+
sign publishing.publications.javaLibrary
10068
}
10169
}

mockito-kotlin/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ buildscript {
1313
dependencies {
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
16-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
1716
}
1817
}
1918

0 commit comments

Comments
 (0)