diff --git a/Jenkinsfile b/Jenkinsfile index 557589ea..d5fdedaa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -137,11 +137,13 @@ pipeline { returnStdout: true ).trim() - RELEASE_TYPE = 'milestone' // .RC? or .M? + RELEASE_TYPE = 'snapshot' - if (PROJECT_VERSION.endsWith('SNAPSHOT')) { + if (PROJECT_VERSION.matches(/.*-RC[0-9]+$/) || PROJECT_VERSION.matches(/.*-M[0-9]+$/)) { + RELEASE_TYPE = "milestone" + } else if (PROJECT_VERSION.endsWith('SNAPSHOT')) { RELEASE_TYPE = 'snapshot' - } else if (PROJECT_VERSION.endsWith('RELEASE')) { + } else if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) { RELEASE_TYPE = 'release' } @@ -224,7 +226,7 @@ pipeline { returnStdout: true ).trim() - if (PROJECT_VERSION.endsWith('RELEASE')) { + if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) { unstash name: 'build_info' sh "ci/promote-to-bintray.sh" } else { @@ -262,7 +264,7 @@ pipeline { returnStdout: true ).trim() - if (PROJECT_VERSION.endsWith('RELEASE')) { + if (PROJECT_VERSION.matches(/.*\.[0-9]+$/)) { unstash name: 'build_info' sh "ci/sync-to-maven-central.sh" } else {