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,7 +17,11 @@ Foreach ($version in $latestVersions) {
$newVersion = [version]$latestVersion $newVersion = [version]$latestVersion
$phase = "" $phase = ""
$newVersionString = "" $newVersionString = ""
switch -regex ($Env:GITHUB_REF) { if(!$Env:GITHUB_REF) {
$phase = 'fork'
$newVersionString = "{0}.{1}.{2}-{3}-{4}" -f $newVersion.Major, $newVersion.Minor, ($newVersion.Build + 1), $phase, $Env:GITHUB_RUN_NUMBER
} else {
switch -regex ($Env:GITHUB_REF) {
'^refs\/heads\/main*.' { '^refs\/heads\/main*.' {
$newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build $newVersionString = "{0}.{1}.{2}" -f $newVersion.Major, $newVersion.Minor, $newVersion.Build
} }
@@ -43,6 +47,7 @@ switch -regex ($Env:GITHUB_REF) {
$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
} }
}
} }