File tree Expand file tree Collapse file tree 3 files changed +25
-10
lines changed Expand file tree Collapse file tree 3 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 1
1
name : Publish package to the Maven Central Repository
2
2
on :
3
- release :
4
- types : [created]
3
+ push :
4
+ branches :
5
+ - release/mavenCentral
5
6
jobs :
6
7
publish :
7
8
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -17,3 +17,4 @@ classes/
17
17
/.settings
18
18
.classpath
19
19
.project
20
+ .vscode
Original file line number Diff line number Diff line change @@ -9,14 +9,15 @@ plugins {
9
9
id ' signing'
10
10
id ' org.owasp.dependencycheck' version ' 12.1.3'
11
11
id ' com.gradleup.shadow' version ' 8.3.7'
12
+ id ' org.jreleaser' version ' 1.19.0'
12
13
}
13
14
14
15
repositories {
15
16
mavenCentral()
16
17
17
18
if (project. hasProperty(" isCI" )) {
18
19
maven {
19
- url uri(' https://oss .sonatype.org/content/repositories/snapshots/ ' )
20
+ url uri(' https://central .sonatype.com/api/v1/publisher ' )
20
21
mavenContent {
21
22
snapshotsOnly()
22
23
}
@@ -160,13 +161,7 @@ publishing {
160
161
}
161
162
repositories {
162
163
maven {
163
- credentials {
164
- username = System . getenv(" MAVEN_USERNAME" )
165
- password = System . getenv(" MAVEN_PASSWORD" )
166
- }
167
- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
168
- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/'"
169
- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
164
+ url = layout. buildDirectory. dir(' staging-deploy' )
170
165
}
171
166
}
172
167
}
@@ -179,6 +174,24 @@ signing {
179
174
sign publishing. publications. mavenJava
180
175
}
181
176
177
+ jreleaser {
178
+ signing {
179
+ active = ' ALWAYS'
180
+ armored = true
181
+ }
182
+ deploy {
183
+ maven {
184
+ mavenCentral {
185
+ sonatype {
186
+ active = ' ALWAYS'
187
+ url = ' https://central.sonatype.com/api/v1/publisher'
188
+ stagingRepository(' build/staging-deploy' )
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+
182
195
wrapper {
183
196
gradleVersion = ' 8.14'
184
197
distributionType = Wrapper.DistributionType . ALL
You can’t perform that action at this time.
0 commit comments