Skip to content

Commit

Permalink
finalized build process for first beta release
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Jun 14, 2024
1 parent 18da4ad commit 1430a77
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
21 changes: 19 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 ){
Expand All @@ -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 )
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1430a77

Please sign in to comment.