updating script for forked builds

This commit is contained in:
Andrew Welker
2020-06-29 14:18:14 -06:00
parent 4d4230d9f4
commit 6b908e18de

View File

@@ -17,31 +17,36 @@ Foreach ($version in $latestVersions) {
$newVersion = [version]$latestVersion $newVersion = [version]$latestVersion
$phase = "" $phase = ""
$newVersionString = "" $newVersionString = ""
switch -regex ($Env:GITHUB_REF) { if(!$Env:GITHUB_REF) {
'^refs\/heads\/main*.' { $phase = 'fork'
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
} } else {
'^refs\/heads\/feature\/*.' { switch -regex ($Env:GITHUB_REF) {
$phase = 'alpha' '^refs\/heads\/main*.' {
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER $newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build
} }
'^refs\/heads\/release\/*.' { '^refs\/heads\/feature\/*.' {
$splitRef = $Env:GITHUB_REF -split "/" $phase = 'alpha'
$version = [version]($splitRef[-1] -replace "v", "") $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
$phase = 'rc' }
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER '^refs\/heads\/release\/*.' {
} $splitRef = $Env:GITHUB_REF -split "/"
'^refs\/heads\/development*.' { $version = [version]($splitRef[-1] -replace "v", "")
$phase = 'beta' $phase = 'rc'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $version.Major, $version.Minor, $version.Build, $phase, $Env:GITHUB_RUN_NUMBER
} }
'^refs\/heads\/hotfix\/*.' { '^refs\/heads\/development*.' {
$phase = 'hotfix' $phase = 'beta'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
} }
'^refs\/heads\/bugfix\/*.' { '^refs\/heads\/hotfix\/*.' {
$phase = 'hotfix' $phase = 'hotfix'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER $newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
}
'^refs\/heads\/bugfix\/*.' {
$phase = 'hotfix'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
}
} }
} }