Files
HImage/scripts/package.ps1
T

19 lines
1.0 KiB
PowerShell

param([string]$Iscc = "ISCC.exe")
$ErrorActionPreference = 'Stop'
Push-Location "$PSScriptRoot/.."
try {
cargo build --release --locked
if ($LASTEXITCODE) { throw 'Release build failed' }
New-Item -ItemType Directory -Force dist | Out-Null
Copy-Item target/release/himage.exe dist/HImage.exe
New-Item -ItemType Directory -Force dist/licenses,dist/assets | Out-Null
Copy-Item licenses/* dist/licenses -Recurse -Force
Copy-Item assets/icon.png dist/assets/icon.png
Copy-Item assets/fonts/OFL.txt dist/licenses/Noto-OFL.txt
Copy-Item README.md dist/README.md
& $Iscc platform/windows/installer.iss
if ($LASTEXITCODE) { throw 'Installer build failed' }
Compress-Archive -Path dist/HImage.exe,dist/README.md,dist/licenses,dist/assets -DestinationPath dist/HImage-Portable.zip -Force
Compress-Archive -Path src,assets,licenses,platform,scripts,examples,build.rs,Cargo.toml,Cargo.lock,rust-toolchain.toml,README.md,.gitignore -DestinationPath dist/HImage-Source.zip -Force
} finally { Pop-Location }