refactor(zips): changes on how the compiler dose the zip to keep it cleaner

This commit is contained in:
2025-07-14 21:57:04 -05:00
parent b72a10db94
commit 2472374157

View File

@@ -66,17 +66,38 @@ if ($existingZips.Count -gt $keepReleases) {
Write-Host "`nPackaging release: $($zipName)" Write-Host "`nPackaging release: $($zipName)"
$filesToInclude = @( # Create a temporary staging directory
"backend\lst_backend.exe", $tempStageDir = New-Item -ItemType Directory -Path (Join-Path $env:TEMP "lst_staging") -Force
"frontend\.nitro",
"frontend\.tanstack", # Copy files to organized structure
"frontend\.output", $filesToCopy = @(
"frontend\public", @{ Source = "backend\lst_backend.exe"; Destination = "backend\lst_backend.exe" },
"package.json", @{ Source = "LstWrapper\publish\*"; Destination = "lstwrapper\" },
"CHANGELOG.md", @{ Source = "frontend\.nitro"; Destination = "frontend\.nitro" },
"README.md" @{ Source = "frontend\.tanstack"; Destination = "frontend\.tanstack" },
@{ Source = "frontend\.output"; Destination = "frontend\.output" },
@{ Source = "frontend\public"; Destination = "frontend\public" },
@{ Source = "package.json"; Destination = "frontend\package.json" },
@{ Source = "CHANGELOG.md"; Destination = "CHANGELOG.md" },
@{ Source = "README.md"; Destination = "README.md" }
) )
Compress-Archive -Path $filesToInclude -DestinationPath $zipPath foreach ($file in $filesToCopy) {
$destPath = Join-Path $tempStageDir $file.Destination
New-Item -ItemType Directory -Path (Split-Path $destPath -Parent) -Force | Out-Null
Copy-Item -Path $file.Source -Destination $destPath -Recurse -Force
}
Write-Host "`nRelease package created at: $($zipPath)" # Create the zip from the staged directory
Compress-Archive -Path "$tempStageDir\*" -DestinationPath $zipPath
# Clean up temporary directory
Remove-Item $tempStageDir -Recurse -Force
Write-Host "`nRelease package created at: $($zipPath)"
Write-Host "Organized structure:"
Write-Host "- backend/"
Write-Host "- frontend/"
Write-Host "- lstwrapper/"
Write-Host "- CHANGELOG.md"
Write-Host "- README.md"