Skip to content

Commit a1996a1

Browse files
Oleh DokukaOlegDokuka
Oleh Dokuka
authored andcommitted
migrates to Sonotype releasing and adds Github Packages for snapshoting
Signed-off-by: Oleh Dokuka <[email protected]> Signed-off-by: Oleh Dokuka <[email protected]> Signed-off-by: Oleh Dokuka <[email protected]>
1 parent b8c7c2e commit a1996a1

File tree

13 files changed

+78
-82
lines changed

13 files changed

+78
-82
lines changed

Diff for: .github/workflows/gradle-release.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ jobs:
3232
- name: Grant execute permission for gradlew
3333
run: chmod +x gradlew
3434
- name: Build with Gradle
35-
run: ./gradlew clean build
36-
- name: Publish Packages to Bintray
37-
run: ./gradlew -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" -Pversion="${githubRef#refs/tags/}" -PbuildNumber="${buildNumber}" bintrayUpload
35+
run: ./gradlew clean build -x test
36+
- name: Publish Packages to Sonotype
37+
run: ./gradlew -Pversion="${githubRef#refs/tags/}" -PbuildNumber="${buildNumber}" sign publishMavenPublicationToSonatypeRepository
3838
env:
39-
bintrayUser: ${{ secrets.bintrayUser }}
40-
bintrayKey: ${{ secrets.bintrayKey }}
41-
sonatypeUsername: ${{ secrets.sonatypeUsername }}
42-
sonatypePassword: ${{ secrets.sonatypePassword }}
4339
githubRef: ${{ github.ref }}
44-
buildNumber: ${{ github.run_number }}
40+
buildNumber: ${{ github.run_number }}
41+
ORG_GRADLE_PROJECT_signingKey: ${{secrets.signingKey}}
42+
ORG_GRADLE_PROJECT_signingPassword: ${{secrets.signingPassword}}
43+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{secrets.sonatypeUsername}}
44+
ORG_GRADLE_PROJECT_sonatypePassword: ${{secrets.sonatypePassword}}

Diff for: build.gradle

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616

1717
plugins {
1818
id 'com.github.sherter.google-java-format' version '0.8' apply false
19-
id 'com.jfrog.artifactory' version '4.15.2' apply false
20-
id 'com.jfrog.bintray' version '1.8.5' apply false
19+
id 'com.jfrog.artifactory' version '4.21.0' apply false
2120
id 'me.champeau.gradle.jmh' version '0.5.0' apply false
22-
id 'io.spring.dependency-management' version '1.0.9.RELEASE' apply false
21+
id 'io.spring.dependency-management' version '1.0.11.RELEASE' apply false
2322
id 'io.morethan.jmhreport' version '0.9.0' apply false
2423
}
2524

Diff for: gradle/bintray.gradle

-63
This file was deleted.

Diff for: gradle/github-pkg.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
subprojects {
2+
3+
plugins.withType(JavaLibraryPlugin) {
4+
plugins.withType(MavenPublishPlugin) {
5+
publishing {
6+
repositories {
7+
maven {
8+
name = "GitHubPackages"
9+
url = uri("https://maven.pkg.github.com/rsocket/rsocket-java")
10+
credentials {
11+
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
12+
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
13+
}
14+
}
15+
}
16+
}
17+
18+
tasks.named("publish").configure {
19+
onlyIf { System.getenv('SKIP_RELEASE') != "true" }
20+
}
21+
}
22+
}
23+
}

Diff for: gradle/publications.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apply from: "${rootDir}/gradle/artifactory.gradle"
2-
apply from: "${rootDir}/gradle/bintray.gradle"
2+
apply from: "${rootDir}/gradle/github-pkg.gradle"
3+
apply from: "${rootDir}/gradle/sonotype.gradle"
34

45
subprojects {
56
plugins.withType(MavenPublishPlugin) {

Diff for: gradle/sonotype.gradle

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
subprojects {
2+
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
3+
plugins.withType(JavaLibraryPlugin) {
4+
plugins.withType(MavenPublishPlugin) {
5+
plugins.withType(SigningPlugin) {
6+
7+
signing {
8+
//requiring signature if there is a publish task that is not to MavenLocal
9+
required { gradle.taskGraph.allTasks.any { it.name.toLowerCase().contains("publish") && !it.name.contains("MavenLocal") } }
10+
def signingKey = project.findProperty("signingKey")
11+
def signingPassword = project.findProperty("signingPassword")
12+
13+
useInMemoryPgpKeys(signingKey, signingPassword)
14+
15+
afterEvaluate {
16+
sign publishing.publications.maven
17+
}
18+
}
19+
20+
publishing {
21+
repositories {
22+
maven {
23+
name = "sonatype"
24+
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
25+
credentials {
26+
username project.findProperty("sonatypeUsername")
27+
password project.findProperty("sonatypePassword")
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}
35+
}
36+
}

Diff for: rsocket-bom/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
plugins {
1717
id 'java-platform'
1818
id 'maven-publish'
19+
id 'signing'
1920
id 'com.jfrog.artifactory'
20-
id 'com.jfrog.bintray'
2121
}
2222

2323
description = 'RSocket Java Bill of materials.'

Diff for: rsocket-core/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
plugins {
1818
id 'java-library'
1919
id 'maven-publish'
20+
id 'signing'
2021
id 'com.jfrog.artifactory'
21-
id 'com.jfrog.bintray'
2222
id 'io.morethan.jmhreport'
2323
id 'me.champeau.gradle.jmh'
2424
}

Diff for: rsocket-load-balancer/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
plugins {
1818
id 'java-library'
1919
id 'maven-publish'
20+
id 'signing'
2021
id 'com.jfrog.artifactory'
21-
id 'com.jfrog.bintray'
2222
}
2323

2424
dependencies {

Diff for: rsocket-micrometer/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
plugins {
1818
id 'java-library'
1919
id 'maven-publish'
20+
id 'signing'
2021
id 'com.jfrog.artifactory'
21-
id 'com.jfrog.bintray'
2222
}
2323

2424
dependencies {

Diff for: rsocket-test/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
plugins {
1818
id 'java-library'
1919
id 'maven-publish'
20+
id 'signing'
2021
id 'com.jfrog.artifactory'
21-
id 'com.jfrog.bintray'
2222
}
2323

2424
dependencies {

Diff for: rsocket-transport-local/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
plugins {
1818
id 'java-library'
1919
id 'maven-publish'
20+
id 'signing'
2021
id 'com.jfrog.artifactory'
21-
id 'com.jfrog.bintray'
2222
}
2323

2424
dependencies {

Diff for: rsocket-transport-netty/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
plugins {
1818
id 'java-library'
1919
id 'maven-publish'
20+
id 'signing'
2021
id 'com.jfrog.artifactory'
21-
id 'com.jfrog.bintray'
2222
id "com.google.osdetector" version "1.4.0"
2323
}
2424

0 commit comments

Comments
 (0)