Files
Analog_System_Monitor/analog_system_monitor_dotnet/release.ps1
2026-01-16 09:39:25 +01:00

52 lines
1.4 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================
# Analog System Monitor Release Script
# Creates a clean, single-file Windows build
# ============================================
param(
[string]$Version = "1.0.0"
)
$ErrorActionPreference = "Stop"
Write-Host "=== Analog System Monitor Release Script ==="
Write-Host "Version: $Version"
Write-Host ""
# Paths
$project = "analog_system_monitor.csproj"
$releaseDir = "release\$Version"
# Clean old release
if (Test-Path $releaseDir) {
Write-Host "Cleaning old release directory..."
Remove-Item -Recurse -Force $releaseDir
}
# Ensure release directory exists
New-Item -ItemType Directory -Force -Path $releaseDir | Out-Null
Write-Host "Restoring packages..."
dotnet restore $project
Write-Host "Cleaning project..."
dotnet clean $project -c Release
Write-Host "Publishing single-file executable..."
dotnet publish $project `
-c Release `
-r win-x64 `
--self-contained true `
/p:PublishSingleFile=true `
/p:IncludeNativeLibrariesForSelfExtract=true `
/p:DebugType=None `
/p:DebugSymbols=false `
/p:Version=$Version `
-o "$releaseDir"
Write-Host ""
Write-Host "============================================"
Write-Host " Release build completed successfully"
Write-Host " Output folder: $releaseDir"
Write-Host "============================================"