mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-14 04:57:15 +00:00
updating script for forked builds
This commit is contained in:
parent
4d4230d9f4
commit
6b908e18de
1 changed files with 30 additions and 25 deletions
55
.github/scripts/GenerateVersionNumber.ps1
vendored
55
.github/scripts/GenerateVersionNumber.ps1
vendored
|
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue