Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini committed Oct 14, 2024
2 parents 624cdd5 + 0c46de5 commit 792b1f5
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
id 'com.diffplug.spotless' version '6.25.0'
id 'signing'
id 'maven-publish'
id 'net.researchgate.release' version '3.0.2'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'net.researchgate.release' version '3.0.2'
}

wrapper {
Expand Down Expand Up @@ -67,8 +67,8 @@ nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
username = project.findProperty('sonatypeUser') ?: ''
password = project.findProperty('sonatypePassword') ?: ''
username = project.findProperty('ossSonatypeUsername') ?: ''
password = project.findProperty('ossSonatypePassword') ?: ''
}
}
}
Expand Down Expand Up @@ -115,22 +115,13 @@ publishing {
}

release {
buildTasks = ['releaseBuild']
buildTasks = ['doRelease']
git {
requireBranch.set('6.x')
}
}

task releaseBuild {
dependsOn(
'checkLastVersionValue',
'clean',
'build',
project.getTasksByName('publishToSonatype', true)
)
}

tasks.register('checkLastVersionValue') {
def checkLastVersionValueTask = tasks.register('checkLastVersionValue') {
doLast {
if(version.endsWith('SNAPSHOT')) {
throw new GradleException("version '$version' ends with SNAPSHOT, this is not a release build!")
Expand All @@ -151,6 +142,16 @@ def updateLastVersionValueTask = tasks.register('updateLastVersionValue') {
}
}

tasks.register('doRelease') {
dependsOn(
checkLastVersionValueTask,
'initializeSonatypeStagingRepository',
'clean',
'build',
project.getTasksByName('publishToSonatype', true)
)
}

model {
tasks.unSnapshotVersion {
dependsOn updateLastVersionValueTask
Expand Down

0 comments on commit 792b1f5

Please sign in to comment.