13 lines
993 B
PowerShell
13 lines
993 B
PowerShell
param([string]$Configuration = 'Release')
|
|
$ErrorActionPreference = 'Stop'
|
|
$project = Split-Path $PSScriptRoot -Parent
|
|
$output = Join-Path $project 'dist\MusicBridge-win-x64'
|
|
New-Item -ItemType Directory -Path $output -Force | Out-Null
|
|
& dotnet publish (Join-Path $project 'MusicBridge.Agent.csproj') -c $Configuration -r win-x64 --self-contained true -p:PublishSingleFile=false -o (Join-Path $output 'app')
|
|
if ($LASTEXITCODE -ne 0) { throw 'Publish failed.' }
|
|
Copy-Item -LiteralPath (Join-Path $PSScriptRoot 'Install.ps1'),(Join-Path $PSScriptRoot 'Install.cmd'),(Join-Path $PSScriptRoot 'Uninstall.ps1') -Destination $output -Force
|
|
Copy-Item -LiteralPath (Join-Path $project 'INSTALL.md') -Destination $output -Force
|
|
Copy-Item -LiteralPath (Join-Path $PSScriptRoot 'Firewall.ps1') -Destination $output -Force
|
|
Compress-Archive -Path (Join-Path $output '*') -DestinationPath (Join-Path $project 'dist\MusicBridge-win-x64.zip') -Force
|
|
Write-Host "Package: $project\dist\MusicBridge-win-x64.zip"
|