-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
33 lines (25 loc) · 1.29 KB
/
build.ps1
File metadata and controls
33 lines (25 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# MatchY release build script
# Usage: .\build.ps1
# Produces: NSIS installer, MSI installer, and portable zip in C:\cargo-target\matchy\release\bundle\
$ErrorActionPreference = "Stop"
$AppDir = "$PSScriptRoot\matchy\crates\matchy-app"
$TauriBin = "$AppDir\frontend\node_modules\.bin\tauri.cmd"
$TargetDir = "C:\cargo-target\matchy"
$BundleDir = "$TargetDir\release\bundle"
Write-Host "==> Building MatchY release..." -ForegroundColor Cyan
Set-Location $AppDir
$env:CARGO_TARGET_DIR = $TargetDir
& $TauriBin build --bundles nsis
if ($LASTEXITCODE -ne 0) { Write-Error "tauri build failed"; exit 1 }
# Tauri has no 'portable' bundle target — create the zip manually from the compiled exe.
$ExePath = "$TargetDir\release\matchy-app.exe"
$PortableDir = "$BundleDir\portable"
$Version = (Select-String -Path "$PSScriptRoot\matchy\Cargo.toml" -Pattern '^version\s*=\s*"([^"]+)"' | Select-Object -First 1).Matches.Groups[1].Value
$PortableZip = "$PortableDir\MatchY_${Version}_x64_portable.zip"
New-Item -ItemType Directory -Force -Path $PortableDir | Out-Null
Compress-Archive -Path $ExePath -DestinationPath $PortableZip -Force
Write-Host ""
Write-Host "==> Build complete. Artifacts:" -ForegroundColor Green
Get-ChildItem -Recurse -File $BundleDir | ForEach-Object {
Write-Host " $($_.FullName)"
}