@@ -4,14 +4,15 @@ plugins {
4
4
id " maven-publish"
5
5
id " signing"
6
6
id " checkstyle"
7
+ id(" org.jreleaser" ) version " 1.17.0"
7
8
}
8
9
9
10
repositories {
10
11
mavenCentral()
11
12
}
12
13
13
14
group = " org.embulk"
14
- version = " 0.3.0 -SNAPSHOT"
15
+ version = " 0.3.1 -SNAPSHOT"
15
16
description " Timestamp parser and formatter for Embulk and Embulk plugins"
16
17
17
18
configurations {
@@ -136,19 +137,13 @@ publishing {
136
137
}
137
138
}
138
139
140
+ // We release this to Maven Central with JReleaser tentatively because there is no first-party Gradle plugin yet.
141
+ // https://central.sonatype.org/news/20250326_ossrh_sunset/#support-for-gradle-and-other-publishers
142
+ //
143
+ // Once the first-part Gradle plugin for the new Maven Central Portal is available, we will get back to the first-party.
139
144
repositories {
140
- maven { // publishMavenPublicationToMavenCentralRepository
141
- name = " mavenCentral"
142
- if (project. version. endsWith(" -SNAPSHOT" )) {
143
- url " https://oss.sonatype.org/content/repositories/snapshots"
144
- } else {
145
- url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
146
- }
147
-
148
- credentials {
149
- username = project. hasProperty(" ossrhUsername" ) ? ossrhUsername : " "
150
- password = project. hasProperty(" ossrhPassword" ) ? ossrhPassword : " "
151
- }
145
+ maven { // https://jreleaser.org/guide/latest/examples/maven/staging-artifacts.html#_gradle
146
+ url = layout. buildDirectory. dir(" jreleaser-staging-deploy" )
152
147
}
153
148
}
154
149
}
@@ -158,9 +153,54 @@ signing {
158
153
logger. lifecycle(" Signing with an in-memory key." )
159
154
useInMemoryPgpKeys(signingKey, signingPassword)
160
155
}
161
- sign publishing. publications. maven
156
+ // Disabled: Signed directly by JReleaser when being released by JReleaser.
157
+ // sign publishing.publications.maven
162
158
}
163
159
160
+ jreleaser {
161
+ release {
162
+ github {
163
+ enabled = true // Not intended, but needed: https://github.com/jreleaser/jreleaser/discussions/1725
164
+ token = " unavailable"
165
+ skipTag = true
166
+ skipRelease = true
167
+ }
168
+ }
169
+
170
+ signing { // https://jreleaser.org/guide/latest/reference/signing.html
171
+ active = org.jreleaser.model.Active . ALWAYS
172
+ armored = true
173
+ mode = org.jreleaser.model.Signing.Mode . MEMORY
174
+ publicKey = System . getenv(" JRELEASER_GPG_PUBLIC_KEY" ) ?: " N/A"
175
+ secretKey = System . getenv(" JRELEASER_GPG_SECRET_KEY" ) ?: " N/A"
176
+ passphrase = System . getenv(" JRELEASER_GPG_PASSPHRASE" ) ?: " N/A"
177
+ }
178
+
179
+ deploy {
180
+ maven {
181
+ mavenCentral { // https://jreleaser.org/guide/latest/reference/deploy/maven/maven-central.html
182
+ sonatype {
183
+ active = org.jreleaser.model.Active . ALWAYS
184
+ url = " https://central.sonatype.com/api/v1/publisher"
185
+ snapshotSupported = false
186
+ username = System . getenv(" JRELEASER_MAVENCENTRAL_USERNAME" )
187
+ password = System . getenv(" JRELEASER_MAVENCENTRAL_PASSWORD" )
188
+ authorization = " BEARER"
189
+ applyMavenCentralRules = true
190
+ stagingRepository(" $buildDir /jreleaser-staging-deploy" )
191
+ retryDelay = 60
192
+ maxRetries = 60
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+
199
+ jreleaserRelease. dependsOn publish
200
+ jreleaserRelease. shouldRunAfter publish
201
+ jreleaserUpload. dependsOn publish
202
+ jreleaserUpload. shouldRunAfter publish
203
+
164
204
test {
165
205
useJUnitPlatform()
166
206
testLogging {
0 commit comments