Skip to content

Commit 092e8f8

Browse files
ci: migrate publishing to maven central (#106686)
1 parent 383b3d3 commit 092e8f8

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup
2121
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-setup@v2
2222
- name: Release
23-
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-release@v2
23+
uses: IntershopCommunicationsAG/.github/actions/gradle-plugin-release@v3
2424
with:
2525
signing-file: ${{ secrets.SIGNINGFILE }}
2626
signing-key-id: ${{ secrets.SIGNINGKEYID }}

build.gradle.kts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.asciidoctor.gradle.jvm.AsciidoctorTask
2+
import io.gitee.pkmer.enums.PublishingType
23

34
/*
45
* Copyright 2022 Intershop Communications AG.
@@ -43,6 +44,8 @@ plugins {
4344
id("com.gradle.plugin-publish") version "1.3.0"
4445

4546
id("com.dorongold.task-tree") version "4.0.0"
47+
48+
id("io.gitee.pkmer.pkmerboot-central-publisher") version "1.1.1"
4649
}
4750

4851
// release configuration
@@ -211,6 +214,8 @@ tasks {
211214
}
212215
}
213216

217+
val stagingRepoDir = project.layout.buildDirectory.dir("stagingRepo")
218+
214219
publishing {
215220
publications {
216221
create("intershopMvn", MavenPublication::class.java) {
@@ -224,7 +229,8 @@ publishing {
224229
artifact(File(buildDir, "docs/asciidoc/docbook/README.xml")) {
225230
classifier = "docbook"
226231
}
227-
232+
}
233+
withType<MavenPublication>().configureEach {
228234
pom {
229235
name.set(project.name)
230236
description.set(project.description)
@@ -268,6 +274,23 @@ publishing {
268274
}
269275
}
270276

277+
pkmerBoot {
278+
sonatypeMavenCentral{
279+
// the same with publishing.repositories.maven.url in the configuration.
280+
stagingRepository = stagingRepoDir
281+
282+
/**
283+
* get username and password from
284+
* <a href="https://central.sonatype.com/account"> central sonatype account</a>
285+
*/
286+
username = sonatypeUsername
287+
password = sonatypePassword
288+
289+
// Optional the publishingType default value is PublishingType.AUTOMATIC
290+
publishingType = PublishingType.USER_MANAGED
291+
}
292+
}
293+
271294
signing {
272295
sign(publishing.publications["intershopMvn"])
273296
}

0 commit comments

Comments
 (0)