Skip to content

Commit cef7218

Browse files
committed
Refactor JReleaser configuration to root level
Moved JReleaser plugin configuration to the root build file for better maintainability and applied plugin globally. Simplified workflow by removing redundant parameters and updated the version to 0.2.1. Adjusted signing and deployment logic for consistency.
1 parent b6c4f32 commit cef7218

File tree

2 files changed

+41
-44
lines changed

2 files changed

+41
-44
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_GPG_PUBLIC_KEY }}
5959
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_USERNAME }}
6060
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_BRIGHTINVENTIONS_PL_PASSWORD }}
61-
run: gradle jreleaserRelease --stacktrace --info --max-workers=3
61+
run: gradle jreleaserRelease --stacktrace --info
6262

6363
- name: Update to next development version
6464
run: |

build.gradle.kts

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
22
import org.jreleaser.model.Active
3+
import java.time.LocalDate
34

45
plugins {
56
kotlin("jvm") version libs.versions.kotlin.get() apply false
67
kotlin("plugin.spring") version libs.versions.kotlin.get() apply false
78
id("java-library")
8-
alias(libs.plugins.jreleaser) apply false
9+
alias(libs.plugins.jreleaser) // Apply JReleaser at the root level
910
}
1011

1112
allprojects {
1213
group = "pl.brightinventions.spring.modulith"
13-
version = "0.1.6"
14+
version = "0.2.1"
1415

1516
repositories {
1617
mavenCentral()
@@ -39,8 +40,6 @@ subprojects {
3940
}
4041

4142
if (project.name != "examples") {
42-
apply(plugin = "org.jreleaser")
43-
4443
java {
4544
withJavadocJar()
4645
withSourcesJar()
@@ -82,53 +81,51 @@ subprojects {
8281
}
8382
}
8483
}
85-
val gradleProject = project
86-
configure<org.jreleaser.gradle.plugin.JReleaserExtension> {
87-
gitRootSearch = true
88-
project {
89-
description = gradleProject.description ?: gradleProject.name
90-
authors = listOf("Bright Inventions")
91-
license = "MIT"
92-
links {
93-
homepage = "https://github.com/bright/spring-modulith-gcp"
94-
bugTracker = "https://github.com/bright/spring-modulith-gcp/issues"
95-
contact = "https://brightinventions.pl"
96-
}
97-
inceptionYear = "2025"
98-
vendor = "Bright Inventions"
99-
copyright = ""
100-
}
84+
}
85+
}
10186

102-
release {
103-
github {
104-
commitAuthor {
105-
name = "Bright Inventions"
106-
107-
}
108-
}
109-
}
87+
configure<org.jreleaser.gradle.plugin.JReleaserExtension> {
88+
gitRootSearch = true
89+
project {
90+
description = "Spring Modulith GCP integration libraries"
91+
authors = listOf("Bright Inventions")
92+
license = "MIT"
93+
links {
94+
homepage = "https://github.com/bright/spring-modulith-gcp"
95+
bugTracker = "https://github.com/bright/spring-modulith-gcp/issues"
96+
contact = "https://brightinventions.pl"
97+
}
98+
inceptionYear = "2025"
99+
vendor = "Bright Inventions"
100+
copyright = "Copyright (c) ${LocalDate.now().year} Bright Inventions Sp. z o.o."
101+
}
110102

111-
checksum {
112-
individual = true // Generate checksums for each file
103+
release {
104+
github {
105+
commitAuthor {
106+
name = "Bright Inventions"
107+
113108
}
109+
}
110+
}
114111

115-
signing {
116-
active = Active.ALWAYS
117-
armored = true
118-
}
112+
signing {
113+
active = Active.ALWAYS
114+
armored = true
115+
}
119116

120-
deploy {
121-
maven {
122-
mavenCentral {
123-
register("sonatype") { // https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_portal_publisher_api
124-
active = Active.ALWAYS
125-
url = "https://central.sonatype.com/api/v1/publisher"
126-
stagingRepository(layout.buildDirectory.dir("staging-deploy").get().asFile.path)
127-
}
117+
deploy {
118+
maven {
119+
mavenCentral {
120+
register("sonatype") { // https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_portal_publisher_api
121+
active = Active.ALWAYS
122+
url = "https://central.sonatype.com/api/v1/publisher"
123+
subprojects.filter { it.name != "examples" }.forEach { project ->
124+
stagingRepository(project.layout.buildDirectory.dir("staging-deploy").get().asFile.path)
128125
}
126+
129127
}
130128
}
131-
132129
}
133130
}
134131
}

0 commit comments

Comments
 (0)