docs(changelog): add v0.1.1.3 download and SHA256 links; add release automation scripts (upload/prune/manage/checksums)
This commit is contained in:
35
scripts/gen_checksums.ps1
Normal file
35
scripts/gen_checksums.ps1
Normal file
@ -0,0 +1,35 @@
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string]$ZipPath,
|
||||
[Parameter(Mandatory=$true)][string]$BinDir
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
if (-not (Test-Path -LiteralPath $ZipPath)) {
|
||||
throw "ZIP not found: $ZipPath"
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $BinDir)) {
|
||||
throw "BinDir not found: $BinDir"
|
||||
}
|
||||
|
||||
function Write-ChecksumFile {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)][string]$Path
|
||||
)
|
||||
$hash = (Get-FileHash -Algorithm SHA256 -LiteralPath $Path).Hash.ToLower()
|
||||
$outfile = "$Path.sha256"
|
||||
$line = "$hash $([System.IO.Path]::GetFileName($Path))"
|
||||
Set-Content -Path $outfile -NoNewline -Encoding ASCII -Value $line
|
||||
Write-Host "Wrote $outfile"
|
||||
}
|
||||
|
||||
# ZIP checksum
|
||||
Write-ChecksumFile -Path $ZipPath
|
||||
|
||||
# Binaries checksums
|
||||
Get-ChildItem -LiteralPath $BinDir -File | ForEach-Object {
|
||||
Write-ChecksumFile -Path $_.FullName
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user