File tree 2 files changed +41
-18
lines changed
2 files changed +41
-18
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,11 @@ jobs:
16
16
run : chmod +x gradlew
17
17
- name : Check with Gradle
18
18
run : ./gradlew check --info -Pversion=${{ github.event.release.tag_name }}
19
- - name : Publish with Gradle to Sonatype
20
- run : ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --info -Pversion=${{ github.event.release.tag_name }}
19
+ - name : Publish with Gradle to Maven Central
20
+ run : ./gradlew publish jreleaserDeploy --info -Pversion=${{ github.event.release.tag_name }}
21
21
env :
22
22
SIGNING_KEY : ${{ secrets.SIGNING_KEY }}
23
- SIGNING_PASSWORD : ${{ secrets.SIGNING_PASSWORD }}
24
- ORG_GRADLE_PROJECT_sonatypeUsername : ${{ secrets.SONATYPE_USERNAME }}
25
- ORG_GRADLE_PROJECT_sonatypePassword : ${{ secrets.SONATYPE_PASSWORD }}
23
+ SIGNING_PUBLIC_KEY : ${{ secrets.SIGNING_PUBLIC_KEY }}
24
+ JRELEASER_GPG_PASSPHRASE : ${{ secrets.SIGNING_PASSWORD }}
25
+ JRELEASER_MAVENCENTRAL_USERNAME : ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
26
+ JRELEASER_MAVENCENTRAL_PASSWORD : ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' com.google.protobuf' version ' 0.9.5' apply false
3
3
id ' com.avast.gradle.docker-compose' version ' 0.17.12' apply false
4
- id ' io.github.gradle-nexus.publish-plugin ' version ' 2.0 .0'
4
+ id ' org.jreleaser ' version ' 1.18 .0'
5
5
}
6
6
7
7
allprojects {
@@ -14,17 +14,11 @@ ext {
14
14
protobufVersion = ' 3.25.7'
15
15
}
16
16
17
- nexusPublishing {
18
- repositories {
19
- sonatype()
20
- }
21
- }
22
-
23
17
subprojects {
24
18
apply plugin : ' java'
25
19
apply plugin : ' java-library'
26
20
apply plugin : ' maven-publish'
27
- apply plugin : ' signing '
21
+ apply plugin : ' org.jreleaser '
28
22
29
23
sourceCompatibility = JavaVersion . VERSION_1_8
30
24
@@ -81,14 +75,42 @@ subprojects {
81
75
}
82
76
}
83
77
}
78
+ repositories {
79
+ maven {
80
+ url = layout. buildDirectory. dir(' staging-deploy' )
81
+ }
82
+ }
84
83
}
85
84
}
86
85
87
- signing {
88
- String base64Key = System . getenv(' SIGNING_KEY' )
89
- if (base64Key) {
90
- useInMemoryPgpKeys(new String (Base64 . decoder. decode(base64Key)), System . getenv(' SIGNING_PASSWORD' ))
91
- sign publishing. publications
86
+ jreleaser {
87
+ signing {
88
+ active = ' ALWAYS'
89
+ armored = true
90
+ String base64Key = System . getenv(' SIGNING_KEY' )
91
+ if (base64Key) {
92
+ secretKey = new String (Base64 . decoder. decode(base64Key))
93
+ }
94
+ String base64PublicKey = System . getenv(' SIGNING_PUBLIC_KEY' )
95
+ if (base64PublicKey) {
96
+ publicKey = new String (Base64 . decoder. decode(base64PublicKey))
97
+ }
98
+ }
99
+ deploy {
100
+ maven {
101
+ mavenCentral {
102
+ sonatype {
103
+ active = ' ALWAYS'
104
+ url = ' https://central.sonatype.com/api/v1/publisher'
105
+ stagingRepository(' build/staging-deploy' )
106
+ }
107
+ }
108
+ }
109
+ }
110
+ release {
111
+ github {
112
+ enabled = false
113
+ }
92
114
}
93
115
}
94
116
}
You can’t perform that action at this time.
0 commit comments