embed readme

This commit is contained in:
2026-05-29 14:09:05 +08:00
parent 1ee22b7155
commit a2d80d2660
8 changed files with 248 additions and 81 deletions

View File

@@ -112,9 +112,14 @@ if ($Standalone) {
$exeName = "hpl-toolbox-$version.exe"
$exeOut = Join-Path $distDir $exeName
go build -ldflags="-s -w -H windowsgui -X main.AppVersion=$version" -trimpath -o $exeOut .
if ($LASTEXITCODE -ne 0) { Write-Error "go build failed"; exit 1 }
Copy-Item -Path (Join-Path $repoRoot "README.md") -Destination (Join-Path $distDir "README.md") -Force
$embeddedReadme = Join-Path (Get-Location) "README.md"
Copy-Item -Path (Join-Path $repoRoot "README.md") -Destination $embeddedReadme -Force
try {
go build -tags release -ldflags="-s -w -H windowsgui -X main.AppVersion=$version" -trimpath -o $exeOut .
if ($LASTEXITCODE -ne 0) { Write-Error "go build failed"; exit 1 }
} finally {
Remove-Item -Path $embeddedReadme -Force -ErrorAction SilentlyContinue
}
$summary += [pscustomobject]@{
Artifact = $exeName