feat: 统一 Client 发布产物命名 (#102)

This commit is contained in:
chengma
2026-08-10 14:55:17 +08:00
parent 6fd25984d2
commit 240626f945
12 changed files with 119 additions and 25 deletions
+13 -4
View File
@@ -160,23 +160,32 @@ VSVersionInfo(
[Text.UTF8Encoding]::new($false)
)
$portableZip = Join-Path $releaseRoot "$packageName-portable.zip"
# Windows PowerShell 5 may read a UTF-8 script without BOM as the system code page.
# Build the Chinese product name from Unicode code points so the release name is stable.
$portableProductName = -join @(
[char]0x81EA, [char]0x52A8, [char]0x91C7, [char]0x96C6,
[char]0x91C7, [char]0x8D2D, [char]0x5DE5, [char]0x5177
)
$portableZip = Join-Path $releaseRoot "$($portableProductName)_$version.zip"
Compress-Archive -Path (Join-Path $packageRoot "*") -DestinationPath $portableZip -CompressionLevel Optimal
$portableLatestZip = Join-Path $releaseRoot "$portableProductName.zip"
Copy-Item -LiteralPath $portableZip -Destination $portableLatestZip
$updateStage = Join-Path $buildRoot "update-stage"
New-Item -ItemType Directory -Force -Path $updateStage | Out-Null
Copy-Item -LiteralPath $appRoot -Destination (Join-Path $updateStage "app") -Recurse
$updateZip = Join-Path $releaseRoot "$packageName-update.zip"
$updateZip = Join-Path $releaseRoot "CMAutoBuy_$version.zip"
Compress-Archive -Path (Join-Path $updateStage "*") -DestinationPath $updateZip -CompressionLevel Optimal
Write-Host "[7/7] Generating the release manifest..."
$emDash = [char]0x2014
$manifestPath = Join-Path $releaseRoot ("autobuy{0}{0}manifest.json" -f $emDash)
$manifestPath = Join-Path $releaseRoot "autobuy_manifest.json"
Invoke-Checked -FailureMessage "Failed to generate the release manifest" -Command {
& $buildPython (Join-Path $clientRoot "build_tools\release_manifest.py") `
--version $version --update $updateZip --portable $portableZip `
--output $manifestPath
}
$versionedManifestPath = Join-Path $releaseRoot "autobuy_manifest_$version.json"
Copy-Item -LiteralPath $manifestPath -Destination $versionedManifestPath
Write-Host "Build complete: $releaseRoot"
Write-Host "Release manifest: $manifestPath"