mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-15 15:19:57 +00:00
Pipeline to check that version is updated (#43)
* Pipeline to check that version is updated
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
Param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$currentVersion,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$lastVersion
|
||||
)
|
||||
|
||||
if ($currentVersion.StartsWith("v")){
|
||||
$currentVersion = $currentVersion.Substring(1)
|
||||
}
|
||||
|
||||
if ($lastVersion.StartsWith("v")){
|
||||
$lastVersion = $lastVersion.Substring(1)
|
||||
}
|
||||
|
||||
$isNewer = $currentVersion.CompareTo($lastVersion) -eq 1
|
||||
if ($isNewer -eq $false){
|
||||
throw "Version is not incremented. Current version " + $currentVersion + ". Last version " + $lastVersion
|
||||
}
|
||||
else{
|
||||
Write-Host "Version has been incremented"
|
||||
}
|
||||
Reference in New Issue
Block a user