Skip to content

Commit 1328f94

Browse files
committed
use jrelease
1 parent b613884 commit 1328f94

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Test
2020
run: ./gradlew test
2121
- name: Publish artifacts
22-
run: ./gradlew publish
22+
run: ./gradlew publish jreleaserFullRelease

lib/build.gradle.kts

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import org.jreleaser.model.Active
2+
13
plugins {
24
kotlin("jvm") version "1.9.22"
35
`java-library`
4-
id("com.github.ben-manes.versions") version "0.49.0"
5-
signing
66
`maven-publish`
7+
application
8+
id("org.jreleaser") version "1.10.0"
79
}
810

911
repositories {
@@ -27,12 +29,16 @@ java {
2729
withJavadocJar()
2830
}
2931

32+
val projectVersion = "3.7.1"
33+
version = projectVersion
34+
group = "com.luissoares"
35+
3036
publishing {
3137
publications {
3238
create<MavenPublication>("maven") {
3339
groupId = "com.luissoares"
3440
artifactId = "selenium-testing-library"
35-
version = "3.7.1"
41+
version = projectVersion
3642
from(components["kotlin"])
3743
artifact(tasks["sourcesJar"])
3844
artifact(tasks["javadocJar"])
@@ -66,19 +72,32 @@ publishing {
6672
}
6773
repositories {
6874
maven {
69-
name = "OSSRH"
70-
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
71-
credentials {
72-
username = System.getenv("OSSRH_USERNAME")
73-
password = System.getenv("OSSRH_PASSWORD")
74-
}
75+
url = uri(layout.buildDirectory.dir("repos/snapshots"))
7576
}
7677
}
7778
}
7879

79-
signing {
80-
sign(publishing.publications["maven"])
80+
jreleaser {
81+
gitRootSearch = true
82+
signing {
83+
active.set(Active.ALWAYS)
84+
armored.set(true)
85+
}
86+
deploy {
87+
maven {
88+
nexus2 {
89+
create("mavenCentral") {
90+
active.set(Active.ALWAYS)
91+
url.set("https://s01.oss.sonatype.org/service/local")
92+
closeRepository.set(true)
93+
releaseRepository.set(true)
94+
stagingRepository("build/repos/snapshots")
95+
}
96+
}
97+
}
98+
}
8199
}
100+
82101
tasks.withType<JavaCompile> {
83102
options.encoding = "UTF-8"
84103
sourceCompatibility = "11"

0 commit comments

Comments
 (0)