Track latest mod zip artifact
This commit is contained in:
@@ -9,16 +9,22 @@ Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$source = Join-Path $root "src"
|
||||
$dist = Join-Path $root "dist"
|
||||
$releases = Join-Path $root "releases"
|
||||
$zipPath = Join-Path $dist "Brogether-Brogether-$Version.zip"
|
||||
$releaseZipPath = Join-Path $releases "Brogether-Brogether-$Version.zip"
|
||||
|
||||
if (-not (Test-Path $source)) {
|
||||
throw "Missing source folder: $source"
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $dist | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path $releases | Out-Null
|
||||
if (Test-Path $zipPath) {
|
||||
Remove-Item -LiteralPath $zipPath -Force
|
||||
}
|
||||
if (Test-Path $releaseZipPath) {
|
||||
Remove-Item -LiteralPath $releaseZipPath -Force
|
||||
}
|
||||
|
||||
$archive = [System.IO.Compression.ZipFile]::Open($zipPath, [System.IO.Compression.ZipArchiveMode]::Create)
|
||||
try {
|
||||
@@ -37,4 +43,6 @@ finally {
|
||||
$archive.Dispose()
|
||||
}
|
||||
|
||||
Copy-Item -LiteralPath $zipPath -Destination $releaseZipPath -Force
|
||||
Write-Host "Created $zipPath"
|
||||
Write-Host "Updated release artifact $releaseZipPath"
|
||||
|
||||
Reference in New Issue
Block a user