Update release workflows
This commit is contained in:
2
.github/workflows/release-ga.yml
vendored
2
.github/workflows/release-ga.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
--server-id-deploy=repo.spring.io \
|
||||
--repo-resolve=libs-release \
|
||||
--repo-deploy=libs-staging-local
|
||||
echo JFROG_CLI_BUILD_NAME=spring-statemachine-main-release >> $GITHUB_ENV
|
||||
echo JFROG_CLI_BUILD_NAME=spring-statemachine-30x-release >> $GITHUB_ENV
|
||||
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
|
||||
# switch from snapshot to a release version and extract project
|
||||
# version to get used with tagging
|
||||
|
||||
55
build.gradle
55
build.gradle
@@ -783,6 +783,61 @@ configure(rootProject) {
|
||||
}
|
||||
}
|
||||
|
||||
task nextVersion {
|
||||
doLast{
|
||||
def properties = new Properties()
|
||||
def file = new File('gradle.properties')
|
||||
properties.load(file.newDataInputStream())
|
||||
def currentVersion = properties.getProperty('version')
|
||||
if (currentVersion.indexOf('-SNAPSHOT') < 0) {
|
||||
throw new GradleException('Version is a non SNAPSHOT version')
|
||||
} else {
|
||||
def (major, minor, patch) = version.tokenize('.')
|
||||
patch = patch.replace('-SNAPSHOT', '')
|
||||
patch = String.valueOf(patch.toInteger() + 1)
|
||||
def nextVersion = major + '.' + minor + '.' + patch + '-SNAPSHOT'
|
||||
properties.setProperty('version', nextVersion)
|
||||
properties.store(file.newWriter(), null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task milestoneVersion {
|
||||
doLast{
|
||||
def postfix = project.getProperty('statemachineMilestone')
|
||||
if (!(postfix ==~ /(?:M|RC)\d+/)) {
|
||||
throw new GradleException('Illegal milestone version')
|
||||
}
|
||||
def properties = new Properties()
|
||||
def file = new File('gradle.properties')
|
||||
properties.load(file.newDataInputStream())
|
||||
def currentVersion = properties.getProperty('version')
|
||||
if (currentVersion.indexOf('-SNAPSHOT') > 0) {
|
||||
def nextVersion = currentVersion - '-SNAPSHOT' + '-' + postfix
|
||||
properties.setProperty('version', nextVersion)
|
||||
properties.store(file.newWriter(), null)
|
||||
} else {
|
||||
throw new GradleException('Version is not a SNAPSHOT version')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task releaseVersion {
|
||||
doLast{
|
||||
def properties = new Properties()
|
||||
def file = new File('gradle.properties')
|
||||
properties.load(file.newDataInputStream())
|
||||
def currentVersion = properties.getProperty('version')
|
||||
if (currentVersion.indexOf('-SNAPSHOT') > 0) {
|
||||
def nextVersion = currentVersion - '-SNAPSHOT'
|
||||
properties.setProperty('version', nextVersion)
|
||||
properties.store(file.newWriter(), null)
|
||||
} else {
|
||||
throw new GradleException('Version is not a SNAPSHOT version')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives docsZip
|
||||
archives distZip
|
||||
|
||||
Reference in New Issue
Block a user