31869b17ba
Build, Test and the packaging scripts take the version from Get-Version.ps1 and the short commit from the same place. Both MSIs get the four-field version as ProductVersion (X.Y.Z.0 for a release, X.Y.Z.N between releases) instead of the calendar transform. Checksums and release assets take only their own version's files (1.4.0 no longer matches 1.4.0.7's). Publish-Release.ps1 creates the tag vX.Y.Z on the released commit and the release "ExecuteR X.Y.Z" with semantic-release's notes (-NotesFile, -Prerelease), reuses both on a re-run of the same commit, refuses a version already tagged on another commit and skips assets uploaded whole. deploy.sh builds from source with the git version (0.0.0.0 without git) and runs the images it built by that tag. Test.ps1 runs the watchdog tests too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.3 KiB
PowerShell
45 lines
1.3 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Builds the full solution (and optionally the WebUI) with one version
|
|
(scripts/Get-Version.ps1: X.Y.Z for a release, X.Y.Z.N between releases).
|
|
|
|
.EXAMPLE
|
|
./scripts/Build.ps1
|
|
./scripts/Build.ps1 -Configuration Release -IncludeWebUI
|
|
#>
|
|
[CmdletBinding()]
|
|
param(
|
|
[ValidateSet('Debug', 'Release')]
|
|
[string]$Configuration = 'Release',
|
|
[string]$Version,
|
|
[switch]$IncludeWebUI
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
$repoRoot = Split-Path -Parent $PSScriptRoot
|
|
$Version = & (Join-Path $PSScriptRoot 'Get-Version.ps1') -Version $Version
|
|
$short = & (Join-Path $PSScriptRoot 'Get-Version.ps1') -Version $Version -Format Short
|
|
|
|
Write-Host "Version: $Version"
|
|
|
|
dotnet build (Join-Path $repoRoot 'ExecuteR.slnx') -c $Configuration --nologo "-p:UnifiedVersion=$Version" "-p:GitCommitShort=$short"
|
|
if ($LASTEXITCODE -ne 0) { throw "dotnet build failed ($LASTEXITCODE)." }
|
|
|
|
if ($IncludeWebUI) {
|
|
Push-Location (Join-Path $repoRoot 'src/WebUI')
|
|
try {
|
|
if (-not (Test-Path 'node_modules')) {
|
|
npm ci
|
|
if ($LASTEXITCODE -ne 0) { throw "npm ci failed ($LASTEXITCODE)." }
|
|
}
|
|
$env:PUBLIC_BUILD_VERSION = $Version
|
|
npm run build
|
|
if ($LASTEXITCODE -ne 0) { throw "WebUI build failed ($LASTEXITCODE)." }
|
|
}
|
|
finally {
|
|
Pop-Location
|
|
}
|
|
}
|
|
|
|
Write-Host "Build complete ($Version)."
|