added build script
This commit is contained in:
1
analog_system_monitor_dotnet/.gitignore
vendored
1
analog_system_monitor_dotnet/.gitignore
vendored
@@ -3,6 +3,7 @@ bin/
|
||||
obj/
|
||||
out/
|
||||
publish/
|
||||
release/
|
||||
|
||||
# Visual Studio / VS Code
|
||||
.vs/
|
||||
|
||||
51
analog_system_monitor_dotnet/release.ps1
Normal file
51
analog_system_monitor_dotnet/release.ps1
Normal 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 "============================================"
|
||||
Reference in New Issue
Block a user