From 1430a77c4b547391692b935e5fe30a35e19b5ef4 Mon Sep 17 00:00:00 2001 From: Luis Majano Date: Fri, 14 Jun 2024 17:42:38 +0200 Subject: [PATCH] finalized build process for first beta release --- .github/workflows/release.yml | 19 +++++++++---------- build.gradle | 21 +++++++++++++++++++-- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 31ded020f..b79cb5d56 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -212,16 +212,15 @@ jobs: run: | cp .tmp/changelog.md changelog.md - # ACTIVATE ONCE WE GO GOLD - # - name: Bump Version - # run: | - # if [ $LTS == 'true' ] - # then - # gradle bumpPatchVersion --stacktrace --console=plain - # else - # gradle bumpMinorVersion --stacktrace --console=plain - # fi - # git pull + - name: Bump Version + run: | + if [ $LTS == 'true' ] + then + gradle bumpPatchVersion --stacktrace --console=plain + else + gradle bumpBetaVersion --stacktrace --console=plain + fi + git pull - name: Commit Version Bump uses: EndBug/add-and-commit@v9.1.4 diff --git a/build.gradle b/build.gradle index edfdee787..af8e53034 100644 --- a/build.gradle +++ b/build.gradle @@ -123,7 +123,7 @@ dependencies { * Project Wide Helper function * This is not a task, but a reusable UDF */ -project.ext.bumpVersion = { boolean major = false, boolean minor = false, boolean patch = false -> +project.ext.bumpVersion = { boolean major = false, boolean minor = false, boolean patch = false, boolean beta = false -> def propertiesFile = file( './gradle.properties' ); def properties = new Properties(); @@ -133,7 +133,9 @@ project.ext.bumpVersion = { boolean major = false, boolean minor = false, boolea def currentVersion = properties.getProperty( 'version' ) def versionParts = currentVersion.split( '\\.' ) - def newPathVersion = versionParts[ versionTarget ].toInteger() + 1 + if( !beta ){ + def newPathVersion = versionParts[ versionTarget ].toInteger() + 1 + } def newVersion = ''; if( patch ){ @@ -142,6 +144,12 @@ project.ext.bumpVersion = { boolean major = false, boolean minor = false, boolea newVersion = "${versionParts[ 0 ]}.${newPathVersion}.${versionParts[ 2 ]}" } else if( major ){ newVersion = "${newPathVersion}.${versionParts[ 1 ]}.${versionParts[ 2 ]}" + } else if( beta ){ + // Get's the -betaX version. + def betaString = currentVersion.split( '-' )[ 1 ] + // Now we get the beta number + def betaNumber = betaString.split( 'beta' )[ 1 ].toInteger() + 1 + newVersion = currentVersion.split( '-' )[ 0 ] + "-beta${betaNumber}" } properties.setProperty( 'version', newVersion ) @@ -441,6 +449,15 @@ task bumpPatchVersion { } } +/** + * Bump the beta version number + */ +task bumpBetaVersion { + doLast{ + bumpVersion( false, false, false, true ) + } +} + /** * Utility to copy dependencies to build/dependencies * Useful for testing and deebugging