build: use branded release package names
This commit is contained in:
+28
-5
@@ -61,6 +61,31 @@ function Assert-NoExcludedData {
|
||||
}
|
||||
}
|
||||
|
||||
function Compress-ArchiveWithRetry {
|
||||
param(
|
||||
[string]$SourcePath,
|
||||
[string]$DestinationPath,
|
||||
[int]$Attempts = 5,
|
||||
[int]$DelaySeconds = 2
|
||||
)
|
||||
|
||||
for ($attempt = 1; $attempt -le $Attempts; $attempt++) {
|
||||
try {
|
||||
if (Test-Path -LiteralPath $DestinationPath) {
|
||||
Remove-Item -LiteralPath $DestinationPath -Force
|
||||
}
|
||||
Compress-Archive -Path $SourcePath -DestinationPath $DestinationPath -Force
|
||||
return
|
||||
} catch {
|
||||
if ($attempt -ge $Attempts) {
|
||||
throw
|
||||
}
|
||||
Write-Host "压缩发布包被临时文件占用阻塞,等待 $DelaySeconds 秒后重试 ($attempt/$Attempts):$($_.Exception.Message)"
|
||||
Start-Sleep -Seconds $DelaySeconds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$versionFile = Join-Path $repoRoot "app\version.py"
|
||||
if (-not (Test-Path -LiteralPath $versionFile)) {
|
||||
throw "Missing app\version.py"
|
||||
@@ -125,9 +150,9 @@ if (-not (Test-Path -LiteralPath $internalDir)) {
|
||||
Write-Host "Verified onedir layout: _internal present"
|
||||
|
||||
$releaseRoot = Join-Path $repoRoot "release"
|
||||
$releaseName = "$appCodeName-$appVersion"
|
||||
$releaseName = "$appName$appVersion"
|
||||
$releaseDir = Join-Path $releaseRoot $releaseName
|
||||
$portableZip = Join-Path $releaseRoot "$releaseName-portable.zip"
|
||||
$portableZip = Join-Path $releaseRoot "$releaseName.zip"
|
||||
|
||||
foreach ($path in @($releaseDir, $portableZip)) {
|
||||
Assert-InProject -Path $path
|
||||
@@ -156,11 +181,9 @@ $readme = @(
|
||||
Set-Content -LiteralPath (Join-Path $releaseDir "README.txt") -Value $readme -Encoding UTF8
|
||||
|
||||
Assert-NoExcludedData -Root $releaseDir -Excluded $excluded
|
||||
Compress-Archive -Path (Join-Path $releaseDir "*") -DestinationPath $portableZip -Force
|
||||
Compress-ArchiveWithRetry -SourcePath (Join-Path $releaseDir "*") -DestinationPath $portableZip
|
||||
|
||||
Write-Host "$(Decode-Utf8Base64 "5p6E5bu65a6M5oiQOg==") $exePath"
|
||||
Write-Host "$(Decode-Utf8Base64 "5Y+R5biD55uu5b2VOg==") $releaseDir"
|
||||
Write-Host "$(Decode-Utf8Base64 "5L6/5pC65Y6L57yp5YyFOg==") $portableZip"
|
||||
Write-Host (Decode-Utf8Base64 "5LiN6KaB5oqK5pys5ZywIGRhdGHjgIHphY3nva7jgIHmlbDmja7lupPjgIHlm77niYfjgIHml6Xlv5fmiJbnmbvlvZXmgIHlpI3liLbov5vlj5HluIPljIXjgII=")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user