mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-28 17:01:04 +00:00
feat: ship 1.0.8.0 release automation and runtime overhaul
- reduce ASAR IO overhead with streamed archive reads, buffered copies, faster relative-path handling and placeholder integrity records - fix in-place app.asar.unpacked packing/extraction self-copy cases that caused locked-file failures - tighten JS patch discovery with candidate bundle filters and search hints - require prebuilt remote-panel dist artifacts and clean up embedded bridge/script packaging - add unified build entrypoints for PowerShell, cmd and bash and move native CMake output under .tmp - add release metadata validation, changelog section extraction, pre-commit hook and GitHub Actions validation/release pipelines - make CHANGELOG the source of truth for release notes and document the tag-driven release flow - add updater release notes UI with latest/full changelog loading and localize the new update strings - modularize bridge renderer scripts, add installed apps and game status sync, and support remote launch/stop commands - centralize bridge protocol, IPC and WebSocket constants and improve LAN IP selection for QR pairing - refactor remote panel controls/state enums, persist accent color, polish library/session UI and refresh assets
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Version,
|
||||
|
||||
[string]$OutputPath
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$changelogPath = Join-Path $repoRoot 'CHANGELOG.md'
|
||||
|
||||
function Normalize-Version {
|
||||
param([string]$Value)
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Value)) {
|
||||
throw 'Version value cannot be empty.'
|
||||
}
|
||||
|
||||
return $Value.Trim().TrimStart('v', 'V')
|
||||
}
|
||||
|
||||
function Get-ChangelogSection {
|
||||
param(
|
||||
[string]$Content,
|
||||
[string]$TargetVersion
|
||||
)
|
||||
|
||||
$normalizedTargetVersion = Normalize-Version $TargetVersion
|
||||
$normalizedContent = $Content -replace "`r`n", "`n" -replace "`r", "`n"
|
||||
$lines = $normalizedContent -split "`n"
|
||||
$builder = New-Object System.Text.StringBuilder
|
||||
$isInsideSection = $false
|
||||
|
||||
foreach ($line in $lines) {
|
||||
$match = [regex]::Match($line, '^##\s+\[(?<version>[^\]]+)\]')
|
||||
if ($match.Success) {
|
||||
if ($isInsideSection) {
|
||||
break
|
||||
}
|
||||
|
||||
$isInsideSection = (Normalize-Version $match.Groups['version'].Value) -eq $normalizedTargetVersion
|
||||
continue
|
||||
}
|
||||
|
||||
if (-not $isInsideSection) {
|
||||
continue
|
||||
}
|
||||
|
||||
[void]$builder.AppendLine($line)
|
||||
}
|
||||
|
||||
return $builder.ToString().Trim()
|
||||
}
|
||||
|
||||
if (-not (Test-Path $changelogPath)) {
|
||||
throw "CHANGELOG.md not found: $changelogPath"
|
||||
}
|
||||
|
||||
$changelogContent = Get-Content -Path $changelogPath -Raw
|
||||
$section = Get-ChangelogSection -Content $changelogContent -TargetVersion $Version
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($section)) {
|
||||
throw "Changelog section for version '$(Normalize-Version $Version)' was not found in CHANGELOG.md."
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($OutputPath)) {
|
||||
Write-Output $section
|
||||
exit 0
|
||||
}
|
||||
|
||||
$resolvedOutputPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) {
|
||||
$OutputPath
|
||||
}
|
||||
else {
|
||||
Join-Path $repoRoot $OutputPath
|
||||
}
|
||||
|
||||
Set-Content -Path $resolvedOutputPath -Value $section -Encoding utf8
|
||||
Write-Host "Wrote changelog section to $resolvedOutputPath"
|
||||
@@ -0,0 +1,111 @@
|
||||
param(
|
||||
[string]$ExpectedVersion
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$assemblyInfoPath = Join-Path $repoRoot 'WandEnhancer\Properties\AssemblyInfo.cs'
|
||||
$changelogPath = Join-Path $repoRoot 'CHANGELOG.md'
|
||||
|
||||
function Normalize-Version {
|
||||
param([string]$Value)
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($Value)) {
|
||||
throw 'Version value cannot be empty.'
|
||||
}
|
||||
|
||||
return $Value.Trim().TrimStart('v', 'V')
|
||||
}
|
||||
|
||||
function Get-ChangelogSection {
|
||||
param(
|
||||
[string]$Content,
|
||||
[string]$TargetVersion
|
||||
)
|
||||
|
||||
$normalizedTargetVersion = Normalize-Version $TargetVersion
|
||||
$normalizedContent = $Content -replace "`r`n", "`n" -replace "`r", "`n"
|
||||
$lines = $normalizedContent -split "`n"
|
||||
$builder = New-Object System.Text.StringBuilder
|
||||
$isInsideSection = $false
|
||||
|
||||
foreach ($line in $lines) {
|
||||
$match = [regex]::Match($line, '^##\s+\[(?<version>[^\]]+)\]')
|
||||
if ($match.Success) {
|
||||
if ($isInsideSection) {
|
||||
break
|
||||
}
|
||||
|
||||
$isInsideSection = (Normalize-Version $match.Groups['version'].Value) -eq $normalizedTargetVersion
|
||||
continue
|
||||
}
|
||||
|
||||
if (-not $isInsideSection) {
|
||||
continue
|
||||
}
|
||||
|
||||
[void]$builder.AppendLine($line)
|
||||
}
|
||||
|
||||
return $builder.ToString().Trim()
|
||||
}
|
||||
|
||||
if (-not (Test-Path $assemblyInfoPath)) {
|
||||
throw "AssemblyInfo.cs not found: $assemblyInfoPath"
|
||||
}
|
||||
|
||||
if (-not (Test-Path $changelogPath)) {
|
||||
throw "CHANGELOG.md not found: $changelogPath"
|
||||
}
|
||||
|
||||
$assemblyInfoContent = Get-Content -Path $assemblyInfoPath -Raw
|
||||
$changelogContent = Get-Content -Path $changelogPath -Raw
|
||||
|
||||
$assemblyVersionMatch = [regex]::Match($assemblyInfoContent, '(?m)^\s*\[assembly:\s*AssemblyVersion\("(?<version>[^"]+)"\)\]')
|
||||
$fileVersionMatch = [regex]::Match($assemblyInfoContent, '(?m)^\s*\[assembly:\s*AssemblyFileVersion\("(?<version>[^"]+)"\)\]')
|
||||
|
||||
if (-not $assemblyVersionMatch.Success) {
|
||||
throw 'AssemblyVersion was not found in AssemblyInfo.cs.'
|
||||
}
|
||||
|
||||
if (-not $fileVersionMatch.Success) {
|
||||
throw 'AssemblyFileVersion was not found in AssemblyInfo.cs.'
|
||||
}
|
||||
|
||||
$assemblyVersion = Normalize-Version $assemblyVersionMatch.Groups['version'].Value
|
||||
$fileVersion = Normalize-Version $fileVersionMatch.Groups['version'].Value
|
||||
|
||||
if ($assemblyVersion -ne $fileVersion) {
|
||||
throw "AssemblyVersion ($assemblyVersion) and AssemblyFileVersion ($fileVersion) must match."
|
||||
}
|
||||
|
||||
$changelogVersionMatches = [regex]::Matches($changelogContent, '(?m)^##\s+\[(?<version>[^\]]+)\]')
|
||||
if ($changelogVersionMatches.Count -eq 0) {
|
||||
throw 'CHANGELOG.md must contain at least one version section.'
|
||||
}
|
||||
|
||||
$latestChangelogVersion = Normalize-Version $changelogVersionMatches[0].Groups['version'].Value
|
||||
if ($latestChangelogVersion -ne $assemblyVersion) {
|
||||
throw "The first CHANGELOG.md section ($latestChangelogVersion) must match AssemblyInfo.cs version ($assemblyVersion)."
|
||||
}
|
||||
|
||||
$latestSection = Get-ChangelogSection -Content $changelogContent -TargetVersion $assemblyVersion
|
||||
if ([string]::IsNullOrWhiteSpace($latestSection)) {
|
||||
throw "CHANGELOG.md section '$assemblyVersion' is empty."
|
||||
}
|
||||
|
||||
if (-not [string]::IsNullOrWhiteSpace($ExpectedVersion)) {
|
||||
$normalizedExpectedVersion = Normalize-Version $ExpectedVersion
|
||||
if ($normalizedExpectedVersion -ne $assemblyVersion) {
|
||||
throw "Release tag version ($normalizedExpectedVersion) must match AssemblyInfo.cs version ($assemblyVersion)."
|
||||
}
|
||||
|
||||
$expectedSection = Get-ChangelogSection -Content $changelogContent -TargetVersion $normalizedExpectedVersion
|
||||
if ([string]::IsNullOrWhiteSpace($expectedSection)) {
|
||||
throw "CHANGELOG.md section '$normalizedExpectedVersion' is missing or empty."
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Validated release metadata for version $assemblyVersion"
|
||||
Reference in New Issue
Block a user