Implement versioning and build enhancements with cross-platform support

This commit is contained in:
2025-05-25 05:06:21 +02:00
parent 8ba48d2248
commit 48cad7144f
7 changed files with 990 additions and 7 deletions

View File

@ -0,0 +1,38 @@
param(
[switch]$AsCheckmark
)
# Get the list from 'go tool dist list'
$dists = & go tool dist list
# Parse into OS/ARCH pairs
$parsed = $dists | ForEach-Object {
$split = $_ -split '/'
[PSCustomObject]@{ OS = $split[0]; ARCH = $split[1] }
}
# Find all unique OSes and arches, sorted
$oses = $parsed | Select-Object -ExpandProperty OS -Unique | Sort-Object
$arches = $parsed | Select-Object -ExpandProperty ARCH -Unique | Sort-Object
# Group by OS, and build custom objects
$results = foreach ($os in $oses) {
$props = @{}
$props.OS = $os
foreach ($arch in $arches) {
$hasArch = $parsed | Where-Object { $_.OS -eq $os -and $_.ARCH -eq $arch }
if ($hasArch) {
if ($AsCheckmark) {
$props[$arch] = '✅'
} else {
$props[$arch] = $true
}
} else {
$props[$arch] = $false
}
}
[PSCustomObject]$props
}
# Output
$results | Format-Table -AutoSize