mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
For distribution of Radicle on Windows machines, Windows Installer provides a well-known solution, that comes built in to the operating system. It also integrates with the Windows package manager WinGet. Provide an initial version of an `*.msi` build, and integrate it into GitHub actions to allow downloads via build artifacts.
21 lines
633 B
PowerShell
21 lines
633 B
PowerShell
$prefix = "releases"
|
|
|
|
$describe = git describe --match "$prefix/*.*.*" --exclude "$prefix/*.*.*-*.*" --candidates=1 2>$null
|
|
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($describe)) {
|
|
Write-Error -Category ObjectNotFound "tag not found"
|
|
exit 1
|
|
}
|
|
|
|
if (-not ($describe.Trim() -match "^$prefix/(\d+)\.(\d+)\.(\d+)(?:-(\d+)-g[0-9a-f]+)?$")) {
|
|
Write-Error -Category ParserError "tag not recognized"
|
|
exit 1
|
|
}
|
|
|
|
$major = [int]$matches[1]
|
|
$minor = [int]$matches[2]
|
|
$patch = [int]$matches[3]
|
|
|
|
$commits = if ([string]::IsNullOrEmpty($matches[4])) { 0 } else { [int]$matches[4] }
|
|
|
|
Write-Output "$major.$minor.$patch.$commits"
|