added build script

This commit is contained in:
2026-01-16 09:39:25 +01:00
parent e796f899f0
commit 12edafd580
2 changed files with 52 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ bin/
obj/
out/
publish/
release/
# Visual Studio / VS Code
.vs/

View File

@@ -0,0 +1,51 @@
# ============================================
# 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 "============================================"