Files
HSMappy/Mappy/create-release.ps1
T
2026-02-26 03:54:51 -05:00

38 lines
1.4 KiB
PowerShell

# Creates a complete HSMappy release zip with all required files.
# Run after: dotnet build -c Release
# Output: bin/Release/HSMappy/latest.zip
$ErrorActionPreference = "Stop"
$ReleaseDir = "$PSScriptRoot\bin\Release"
$ZipPath = "$ReleaseDir\HSMappy\latest.zip"
$OutDir = "$ReleaseDir\HSMappy"
if (-not (Test-Path "$ReleaseDir\HSMappy.dll")) { throw "Missing: $ReleaseDir\HSMappy.dll (run dotnet build -c Release first)" }
if (-not (Test-Path "$ReleaseDir\HSMappy.json")) { throw "Missing: $ReleaseDir\HSMappy.json" }
$Files = @(
"$ReleaseDir\HSMappy.dll",
"$ReleaseDir\HSMappy.json",
"$ReleaseDir\KamiLib.dll",
"$ReleaseDir\HtmlAgilityPack.dll",
"$ReleaseDir\Karashiiro.HtmlAgilityPack.CssSelectors.NetCoreFork.dll",
"$ReleaseDir\Microsoft.Extensions.ObjectPool.dll",
"$ReleaseDir\NetStone.dll",
"$ReleaseDir\Newtonsoft.Json.dll"
)
foreach ($f in $Files) {
if (-not (Test-Path $f)) { throw "Missing: $f" }
}
if (-not (Test-Path $OutDir)) { New-Item -ItemType Directory -Path $OutDir -Force | Out-Null }
if (Test-Path $ZipPath) { Remove-Item $ZipPath -Force }
# Add files to zip from Release root so zip contains HSMappy.dll etc. at root
$FilesToZip = @()
foreach ($f in $Files) {
$FilesToZip += (Get-Item $f).FullName
}
Compress-Archive -Path $FilesToZip -DestinationPath $ZipPath -CompressionLevel Optimal
Write-Host "Created: $ZipPath"