Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 4b67de73 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Auto-Determine release channel, implements #725 (#726)

Update the publish configuration to derive the publishing track form the version number.
parent febbddf8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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()
+17 −0
Original line number Diff line number Diff line
@@ -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")
        }
    }
}
 No newline at end of file