forked from Makazzz/VSCodiumPortable
-
Notifications
You must be signed in to change notification settings - Fork 1
/
bump.ps1
35 lines (32 loc) · 1.53 KB
/
bump.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
33
34
35
try {
Import-Module PsIni
} catch {
Install-Module -Scope CurrentUser PsIni
Import-Module PsIni
}
$repoName = "VSCodium/vscodium"
$releasesUri = "https://api.github.com/repos/$repoName/releases/latest"
try { $tag = (Invoke-WebRequest $releasesUri | ConvertFrom-Json).tag_name }
catch {
Write-Host "Error while pulling API."
echo "SHOULD_COMMIT=no" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
break
}
echo "UPSTREAM_TAG=$tag" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
$appinfo = Get-IniContent ".\VSCodiumPortable\App\AppInfo\appinfo.ini"
if ($appinfo["Version"]["DisplayVersion"] -ne $tag)
{
$appinfo["Version"]["PackageVersion"]=-join($tag,".0")
$appinfo["Version"]["DisplayVersion"]=$tag
$appinfo | Out-IniFile -Force -Encoding ASCII -Pretty -FilePath ".\VSCodiumPortable\App\AppInfo\appinfo.ini"
$installer = Get-IniContent ".\VSCodiumPortable\App\AppInfo\installer.ini"
$installer["DownloadFiles"]["DownloadURL"]=-join("https://github.com/VSCodium/vscodium/releases/download/",$tag,"/VSCodium-win32-x64-",$tag,".zip")
$installer["DownloadFiles"]["DownloadFilename"]=-join("VSCodium-win32-x64-",$tag,".zip")
$installer | Out-IniFile -Force -Encoding ASCII -Pretty -FilePath ".\VSCodiumPortable\App\AppInfo\installer.ini"
Write-Host "Bumped to "+$tag
echo "SHOULD_COMMIT=yes" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
}
else{
Write-Host "No changes."
echo "SHOULD_COMMIT=no" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
}