Files

38 lines
1.1 KiB
PowerShell
Raw Permalink Normal View History

2024-10-22 20:33:24 -07:00
import-module Chocolatey-AU
function global:au_BeforeUpdate($Package) {}
function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
2024-11-14 12:15:37 -08:00
"(?<=url64\s*=\s*)'.*'" = "`'$($Latest.URL64)'" #1
"(?<=checksum64\s*=\s*)'.*'" = "`'$($Latest.Checksum64)'" #2
2024-10-22 20:33:24 -07:00
}
".\wave.nuspec" = @{
2024-11-14 12:15:37 -08:00
"(?<=<version>)[^<]*" = "$($Latest.Version)"
2024-10-22 20:33:24 -07:00
}
}
}
function global:au_GetLatest {
$Releases = "https://api.github.com/repos/wavetermdev/waveterm/releases/latest"
$PageSource = Invoke-RestMethod -Uri $Releases
2024-10-23 11:09:50 -07:00
Write-Host "tag_name=$($PageSource.tag_name)"
if ($PageSource.tag_name -match 'v([\d.]+)(-beta)?' -and 3 -gt $Matches.Count ) {
2024-10-22 20:33:24 -07:00
$Version = $Matches[1]
} else {
2024-10-23 11:09:50 -07:00
throw "Tag name does not match regex or is beta"
2024-10-22 20:33:24 -07:00
}
Write-Host "newversion=$($Version)"
Write-Output "newversion=$($Version)" >> $Env:GITHUB_OUTPUT
@{
Version = $Version
2024-10-23 10:16:09 -07:00
Url64 = "https://dl.waveterm.dev/releases-w2/Wave-win32-x64-$($Version).msi"
2024-11-14 12:19:27 -08:00
ChecksumType64 = 'sha512'
2024-10-22 20:33:24 -07:00
}
}
2024-11-14 12:05:59 -08:00
update -ChecksumFor 64