Files
nexu-io__open-design/tools/release/scripts/prepare-platform-assets.ps1
PerishFire 0bf1b6d6b8 [codex] converge release workflows and stable dry-runs (#4390)
* fix(tools-pack): use junctions for Windows standalone peer deps

* fix(desktop): expose IPC during startup

* fix(tools-pack): preserve Windows inspect diagnostics

* fix(tools-pack): report Windows inspect status errors

* fix(packaged): use Electron net fetch for app protocol

* fix(packaged): load Windows renderer from web sidecar

* fix(desktop): show Windows packaged window during startup

* fix(packaged): disable Windows GPU startup

* fix(tools-pack): keep Windows core smoke observable

* fix(packaged): remove Windows startup probes

* fix(tools-pack): trace Windows desktop IPC status

* fix(tools-pack): add Windows IPC diagnose loop

* fix(release): default beta-s Windows updater feed

* chore: clean merged test eof

* refactor(release): unify prerelease channel model

* chore(release): close prerelease doc escape hatches

* refactor(release): converge release channel workflows

* fix(release): install toolchain in metadata jobs

* fix(release): build release package before contracts

* chore(release): bump development version to 0.10.1

* fix(e2e): seed windows packaged smoke runtime config

* fix(release): install toolchain for metadata publish

* fix(release): materialize betas metadata checkout

* chore(release): bump development version to 0.10.2

* fix(release): allow betas metadata cold start from s3

* fix(e2e): support betas packaged update scenarios

* fix(release): pass betas channel into packaged smoke

* fix(release): set betas channel during self-hosted builds

* fix(release): verify counted channel reservations

* fix(release): use pnpm cmd for betas windows publish

* fix(release): add betas manifest artifact fallback

* fix(release): skip beta-s public metadata fetch

* fix(release): read beta-s manifests from storage

* fix(release): cache beta windows tools-pack builds

* fix(release): inline beta mac tools-pack builds

* fix(pack): deep sign unsigned mac bundles

* docs(pack): document payload-first beta updater validation

* fix(release): align preview tools-pack cache flow

* fix(release): align prerelease tools-pack cache flow

* fix(release): pass github token to prerelease metadata

* fix(release): setup pnpm before feishu notify

* fix(release): add stable dry-run prepublish flow

* fix(release): accept completed prerelease metadata gate

* fix(release): require stable release branches

* fix(release): converge r2 access checks

* fix(updater): use release channel parser for defaults

* fix(updater): harden windows payload relaunch

* fix(release): converge updater smoke fixture contract

* test(e2e): require silent updater fixture output

* fix(release): align stable windows smoke build path

* fix(ci): include release workspace in validation

* fix(ci): repair release validation lanes

Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)

* fix(ci): restore zero-install Feishu notification

Generated-By: looper 0.9.10+codex.autoclean (runner=fixer, agent=codex)

---------

Co-authored-by: Looper <looper@noreply.github.com>
2026-06-23 06:13:21 +00:00

98 lines
4.0 KiB
PowerShell

param(
[Parameter(Mandatory = $true)]
[ValidateSet("win_x64")]
[string]$ReleaseTarget,
[Parameter(Mandatory = $true)]
[string]$ReleaseAssetsDir,
[Parameter(Mandatory = $true)]
[string]$BuildJsonPath,
[Parameter(Mandatory = $true)]
[string]$ReleaseNamespace,
[Parameter(Mandatory = $true)]
[string]$ReleaseVersion,
[Parameter(Mandatory = $true)]
[AllowEmptyString()]
[string]$ReleaseAssetSuffix,
[Parameter(Mandatory = $true)]
[string]$ReleaseChannel,
[Parameter(Mandatory = $true)]
[string]$ReleasePublicOrigin,
[string]$ReleaseVersionPrefix = "",
[string]$ReleaseNotes = "",
[bool]$IncludeZip = $true
)
$ErrorActionPreference = "Stop"
if ($ReleaseTarget -ne "win_x64") {
throw "prepare-platform-assets.ps1 only supports win_x64"
}
New-Item -ItemType Directory -Force -Path $ReleaseAssetsDir | Out-Null
if (-not (Test-Path -LiteralPath $BuildJsonPath)) {
throw "expected build json not found at $BuildJsonPath"
}
$build = Get-Content -LiteralPath $BuildJsonPath -Raw -Encoding utf8 | ConvertFrom-Json
$sourceInstaller = [string]$build.installerPath
$sourcePayload = [string]$build.payloadPath
$sourceZip = [string]$build.portableZipPath
if ([string]::IsNullOrWhiteSpace($sourceInstaller) -or -not (Test-Path -LiteralPath $sourceInstaller)) {
throw "expected installer path from build json not found at $sourceInstaller"
}
if ([string]::IsNullOrWhiteSpace($sourcePayload) -or -not (Test-Path -LiteralPath $sourcePayload)) {
throw "expected launcher payload path from build json not found at $sourcePayload"
}
if ($IncludeZip -and ([string]::IsNullOrWhiteSpace($sourceZip) -or -not (Test-Path -LiteralPath $sourceZip))) {
throw "expected portable zip path from build json not found at $sourceZip"
}
$versionedInstaller = "open-design-$ReleaseVersion$ReleaseAssetSuffix-win-x64-setup.exe"
$versionedPayload = "open-design-$ReleaseVersion$ReleaseAssetSuffix-win-x64-payload.7z"
$versionedZip = "open-design-$ReleaseVersion$ReleaseAssetSuffix-win-x64-portable.zip"
$installerPath = Join-Path $ReleaseAssetsDir $versionedInstaller
Copy-Item -LiteralPath $sourceInstaller -Destination $installerPath -Force
$installerHash = (Get-FileHash -LiteralPath $installerPath -Algorithm SHA256).Hash.ToLowerInvariant()
"$installerHash $versionedInstaller" | Set-Content -Path "$installerPath.sha256" -Encoding utf8
$payloadPath = Join-Path $ReleaseAssetsDir $versionedPayload
Copy-Item -LiteralPath $sourcePayload -Destination $payloadPath -Force
$payloadHash = (Get-FileHash -LiteralPath $payloadPath -Algorithm SHA256).Hash.ToLowerInvariant()
"$payloadHash $versionedPayload" | Set-Content -Path "$payloadPath.sha256" -Encoding utf8
if ($IncludeZip) {
$zipPath = Join-Path $ReleaseAssetsDir $versionedZip
Copy-Item -LiteralPath $sourceZip -Destination $zipPath -Force
$zipHash = (Get-FileHash -LiteralPath $zipPath -Algorithm SHA256).Hash.ToLowerInvariant()
"$zipHash $versionedZip" | Set-Content -Path "$zipPath.sha256" -Encoding utf8
}
$installerBytes = [System.IO.File]::ReadAllBytes($installerPath)
$installerSha512 = [System.Convert]::ToBase64String([System.Security.Cryptography.SHA512]::Create().ComputeHash($installerBytes))
$installerSize = (Get-Item -LiteralPath $installerPath).Length
$publicOrigin = $ReleasePublicOrigin.TrimEnd("/")
$versionPrefix = if ([string]::IsNullOrWhiteSpace($ReleaseVersionPrefix)) {
"$ReleaseChannel/versions/$ReleaseVersion$ReleaseAssetSuffix"
} else {
$ReleaseVersionPrefix
}
$installerUrl = "$publicOrigin/$versionPrefix/$versionedInstaller"
$releaseDate = [DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ")
$notes = if ([string]::IsNullOrWhiteSpace($ReleaseNotes)) {
"Open Design $ReleaseVersion$ReleaseAssetSuffix"
} else {
$ReleaseNotes
}
@(
"version: `"$ReleaseVersion`""
"files:"
" - url: `"$installerUrl`""
" sha512: `"$installerSha512`""
" size: $installerSize"
"path: `"$installerUrl`""
"sha512: `"$installerSha512`""
"releaseDate: `"$releaseDate`""
"releaseNotes: `"$notes`""
) | Set-Content -Path (Join-Path $ReleaseAssetsDir "latest.yml") -Encoding utf8