Skip to content

Commit

Permalink
Auto-Determine release channel, implements #725
Browse files Browse the repository at this point in the history
Update the publish configuration to derive the publishing track form the version number.
  • Loading branch information
dmfs committed Nov 8, 2018
1 parent 5552bce commit d93aeb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
def gitVersion = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--always'
commandLine 'git', 'describe', '--tags', '--always', '--dirty'
standardOutput = stdout
}
return stdout.toString().trim()
Expand Down
17 changes: 17 additions & 0 deletions opentasks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,22 @@ dependencies {
if (project.hasProperty('PLAY_STORE_SERVICE_ACCOUNT_CREDENTIALS')) {
play {
serviceAccountCredentials = file(PLAY_STORE_SERVICE_ACCOUNT_CREDENTIALS)
// the track is determined automatically by the version number format
switch (version){
case ~/^(\d+)(\.\d+)*-\d+-[\w\d]+-dirty$/:
// work in progress goes to the internal track
track = "internal"
break
case ~/^(\d+)(\.\d+)*-\d+-[\w\d]+$/:
// untagged commits go to alpha
track = "alpha"
break
case ~/^(\d+)(\.\d+)*$/:
// tagged commits to go beta, from where they get promoted to releases
track = "beta"
break
default:
throw new IllegalArgumentException("Unrecognized version format")
}
}
}

0 comments on commit d93aeb8

Please sign in to comment.