@@ -4,10 +4,6 @@ buildscript {
44 }
55 dependencies {
66 classpath ' com.cinnober.gradle:semver-git:2.5.0'
7-
8- if (project. findProperty(' yubicoPublish' ) == ' true' ) {
9- classpath ' io.github.gradle-nexus:publish-plugin:1.3.0'
10- }
117 }
128}
139plugins {
@@ -17,14 +13,12 @@ plugins {
1713 // See https://docs.gradle.org/current/userguide/java_platform_plugin.html
1814 // See https://github.com/Yubico/java-webauthn-server/issues/93#issuecomment-822806951
1915 id ' project-convention-publish'
16+ id ' org.jreleaser' version ' 1.21.0'
2017}
2118
2219import com.yubico.gradle.GitUtils
2320
24- rootProject. description = " Metadata root for the com.yubico:webauthn-server-* module family"
25-
2621project. ext. isCiBuild = System . env. CI == ' true'
27- project. ext. publishEnabled = ! isCiBuild && project. findProperty(' yubicoPublish' ) == ' true'
2822
2923wrapper {
3024 gradleVersion = ' 8.14.3'
@@ -67,43 +61,48 @@ allprojects {
6761 }
6862}
6963
70- if (publishEnabled) {
71- apply plugin : ' io.github.gradle-nexus.publish-plugin'
72-
73- nexusPublishing {
74- repositories {
75- sonatype {
76- stagingProfileId = ' 6c61426e6529d'
77-
78- username = ossrhUsername
79- password = ossrhPassword
80- }
64+ task checkJavaVersionBeforeRelease {
65+ doFirst {
66+ if (JavaVersion . current() != JavaVersion . VERSION_17 ) {
67+ throw new RuntimeException (' Release must be built using JDK 17. Current JDK version: ' + JavaVersion . current())
8168 }
8269 }
70+ }
71+
72+ allprojects {
73+ tasks. withType(AbstractCompile ) { shouldRunAfter checkJavaVersionBeforeRelease }
74+ tasks. withType(AbstractTestTask ) { shouldRunAfter checkJavaVersionBeforeRelease }
75+ tasks. withType(Sign ) {
76+ dependsOn checkJavaVersionBeforeRelease
77+ }
8378
84- task checkJavaVersionBeforeRelease {
79+ tasks . withType( Jar ) {
8580 doFirst {
86- if (JavaVersion . current() != JavaVersion . VERSION_17 ) {
87- throw new RuntimeException (' Release must be built using JDK 17. Current JDK version: ' + JavaVersion . current() )
81+ if (GitUtils . getGitCommit(projectDir) == null ) {
82+ throw new RuntimeException (" Failed to get git commit ID " )
8883 }
8984 }
9085 }
86+ }
9187
92- allprojects {
93- tasks. withType(AbstractCompile ) { shouldRunAfter checkJavaVersionBeforeRelease }
94- tasks. withType(AbstractTestTask ) { shouldRunAfter checkJavaVersionBeforeRelease }
95- tasks. withType(Sign ) {
96- dependsOn checkJavaVersionBeforeRelease
97- }
88+ task pitestMerge (type : com.yubico.gradle.pitest.tasks.PitestMergeTask )
9889
99- tasks. withType(Jar ) {
100- doFirst {
101- if (GitUtils . getGitCommit(projectDir) == null ) {
102- throw new RuntimeException (" Failed to get git commit ID" )
90+ jreleaser {
91+ signing {
92+ active = ' ALWAYS'
93+ mode = ' COMMAND'
94+ armored = true
95+ verify = false
96+ }
97+ deploy {
98+ maven {
99+ mavenCentral {
100+ sonatype {
101+ active = ' ALWAYS'
102+ url = ' https://central.sonatype.com/api/v1/publisher'
103+ stagingRepository(' build/staging-deploy' )
103104 }
104105 }
105106 }
106107 }
107108}
108-
109- task pitestMerge (type : com.yubico.gradle.pitest.tasks.PitestMergeTask )
0 commit comments