-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathversioning.ps1
32 lines (26 loc) · 1.36 KB
/
versioning.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#inspiration from https://gist.github.com/kumichou/acefc48476957aad6b0c9abf203c304c
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$bumpKind
)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
function UpdateVersionForUpdater($versionName){
$zipName = $versionName;
if($versionName -eq 'selfcontained'){ $zipName = "FullRelease"}
echo "https://github.com/millerscout/Kenshi-Mod-Manager/releases/download/v$($newVersion)/$($zipName).zip"
if(checkStatus("https://github.com/millerscout/Kenshi-Mod-Manager/releases/download/v$($newVersion)/$($zipName).zip")==1){
$xml = Get-Content -Path "updatelist-$($versionName).xml"
$xml = $xml -replace "<!-- NEXT VERSION -->", "<!-- NEXT VERSION -->`n<item>
<version>$($newVersion).0.0</version>
<url>https://github.com/millerscout/Kenshi-Mod-Manager/releases/download/v$($newVersion)/$($zipName).zip</url>
<changelog>https://github.com/millerscout/Kenshi-Mod-Manager/releases/tag/v$($newVersion)</changelog>
</item>"
Set-Content -Path "updatelist-$($versionName).xml" -Value $xml -Force
}
}
UpdateVersionForUpdater("standalone")
UpdateVersionForUpdater("selfcontained")
Invoke-Expression "git add . | Write-Verbose"
Invoke-Expression "git commit -m 'updatelist Bump.' | Write-Verbose"
Invoke-Expression "git push | Write-Verbose"