Add milestone upload support

This commit is contained in:
Josh Cummings
2022-01-13 17:20:02 -07:00
parent 10873ca84b
commit b332e141ce
4 changed files with 16 additions and 6 deletions

View File

@@ -1,12 +1,18 @@
apply plugin: "com.jfrog.artifactory"
def isSnapshot = version?.endsWith("-SNAPSHOT")
def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$')
artifactory {
contextUrl = 'https://repo.spring.io'
publish {
repository {
repoKey = isSnapshot ? 'libs-snapshot-local' : 'libs-release-local'
repoKey = 'libs-release-local'
if (isSnapshot) {
repoKey = 'libs-snapshot-local'
} else if (isMilestone) {
repoKey = 'libs-milestone-local'
}
if(project.hasProperty('artifactoryUsername')) {
username = artifactoryUsername
password = artifactoryPassword

View File

@@ -1,11 +1,13 @@
def isSnapshot = version?.endsWith("-SNAPSHOT")
def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$')
def isRelease = !(isSnapshot || isMilestone)
task deployArtifacts {
group = 'Deploy tasks'
description = "Deploys the artifacts to either Artifactory or Maven Central"
if(isSnapshot) {
dependsOn "artifactoryPublish"
} else {
if(isRelease) {
dependsOn "uploadArchives"
} else {
dependsOn "artifactoryPublish"
}
}

View File

@@ -1,5 +1,6 @@
def isSnapshot = version?.endsWith("-SNAPSHOT")
def isRelease = !isSnapshot
def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$')
def isRelease = !(isSnapshot || isMilestone)
task finalizeDeployArtifacts {
}

View File

@@ -1,5 +1,6 @@
def isSnapshot = version?.endsWith("-SNAPSHOT")
def isRelease = !isSnapshot
def isMilestone = version?.matches('^.*[.-]M\\d+$') || version?.matches('^.*[.-]RC\\d+$')
def isRelease = !(isSnapshot || isMilestone)
if(project.hasProperty("signing.keyId") && isRelease) {
apply plugin: "signing"