mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-16 21:02:51 +08:00
23be306c65
## Summary - update NuGet dependencies to their latest compatible stable releases while retaining documented compatibility, native, security, and mocking pins - align the nbgv CLI with the central `Nerdbank.GitVersioning` version (3.10.94) and fail explicitly on tool installation/update errors - update the synchronized OpenUSD family to `0.14.0-alpha`; adapt the Vision blank-frame fixture to the new `RenderDiagnosticsState` constructor argument - retain `Microsoft.CodeAnalysis` API packages at the existing 5.0/4.14 host bands: Roslyn 5.9 requires Immutable/Metadata 10.0.1+, while the retained older compiler-host closure is intentionally pinned to 9.0.0 ## Dependency updates - `Dekaf` 1.17.0 → 1.21.1 - legacy ASP.NET Core 2.3 dependencies → 2.3.13; net8/net9 authentication and WebApi test packages → 8.0.31/9.0.20 - `Microsoft.CodeAnalysis.Analyzers` 4.14.0 → 5.9.0 - `TUnit` 1.68.0 → 1.69.0 - `Avalonia` / `Avalonia.Desktop` 12.1.2 → 12.1.3 - schema-test `System.Collections.Immutable` overrides 10.0.11 → 10.0.12 - `AzureSignTool` 3.0.0 → 7.0.1 and `NuGetKeyVaultSignTool` 3.0.45 → 3.2.3 - eight direct OpenUSD packages 0.12.0-alpha → 0.14.0-alpha ## Validation - `dotnet restore UA.slnx --disable-parallel` - clean `UA.slnx` Release build with `CustomTestTarget=net10.0` - `UA.slnx` Release builds with `net48` and `netstandard2.1` - OpenUSD and Vision test suites on net8/net9/net10: 882/882/921 and 484 passed + 1 environment skip on each target - full `Opc.Ua.Tools.Tests` net10.0: 963 passed, 1 skipped - source-generator package validation against a locally packed release package set - updated signing tools installed in an isolated directory; existing `sign` CLI options verified without credentials - nbgv 3.10.94 bootstrap exercised in simulated GitHub CI; disposable committed fixture verified canonical and case-invalid release refs with a four-component version ## Limits No protected signing/publication, Linux/macOS native rendering, or full stress/nightly suites were run locally.
79 lines
2.7 KiB
PowerShell
79 lines
2.7 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Sets CI version build variables and/or returns version information.
|
|
|
|
.DESCRIPTION
|
|
The script is a wrapper around any versioning tool we use and abstracts it from
|
|
the rest of the build system.
|
|
#>
|
|
|
|
# Keep the CLI and the MSBuild package on the same explicit version. A version
|
|
# range or omitted --version would make otherwise identical CI runs use
|
|
# different nbgv behavior as releases appear on nuget.org.
|
|
[xml]$centralPackages = Get-Content -LiteralPath './Directory.Packages.props' -Raw
|
|
$nbgvVersions = @($centralPackages.Project.ItemGroup.PackageVersion |
|
|
Where-Object { $_.Include -eq 'Nerdbank.GitVersioning' } |
|
|
ForEach-Object { $_.Version })
|
|
if ($nbgvVersions.Count -ne 1 -or [string]::IsNullOrWhiteSpace($nbgvVersions[0])) {
|
|
throw 'Directory.Packages.props must declare exactly one Nerdbank.GitVersioning version.'
|
|
}
|
|
|
|
$nbgvVersion = $nbgvVersions[0]
|
|
if ($nbgvVersion -notmatch '^\d+\.\d+\.\d+$') {
|
|
throw "Nerdbank.GitVersioning version '$nbgvVersion' must be an explicit stable version."
|
|
}
|
|
|
|
$toolPath = './tools'
|
|
$toolExecutable = Join-Path $toolPath 'nbgv'
|
|
if ([System.Environment]::OSVersion.Platform -eq [System.PlatformID]::Win32NT) {
|
|
$toolExecutable += '.exe'
|
|
}
|
|
|
|
$toolCommand = if (Test-Path -LiteralPath $toolExecutable) { 'update' } else { 'install' }
|
|
& dotnet @(
|
|
'tool',
|
|
$toolCommand,
|
|
'--tool-path',
|
|
$toolPath,
|
|
'--version',
|
|
$nbgvVersion,
|
|
'--framework',
|
|
'net10.0',
|
|
'nbgv') 2>&1
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Failed to $toolCommand nbgv $nbgvVersion (exit code $LastExitCode)."
|
|
}
|
|
|
|
$props = (& $toolExecutable @("get-version", "-f", "json")) | ConvertFrom-Json
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Error: 'nbgv get-version -f json' failed with $($LastExitCode)."
|
|
}
|
|
|
|
$version = [pscustomobject] @{
|
|
Full = $props.CloudBuildAllVars.NBGV_Version
|
|
Pre = $props.CloudBuildAllVars.NBGV_PrereleaseVersion
|
|
Public = $props.CloudBuildAllVars.NBGV_PublicRelease
|
|
Nuget = $props.CloudBuildAllVars.NBGV_NuGetPackageVersion
|
|
Prefix = $props.CloudBuildAllVars.NBGV_SimpleVersion
|
|
Revision = $props.CloudBuildAllVars.NBGV_VersionRevision
|
|
}
|
|
|
|
# Call versioning for build
|
|
if ($version.Public -eq 'True')
|
|
{
|
|
& $toolExecutable @("cloud", "-c", "-a", "-v", "$($version.Full)$($version.Pre)")
|
|
}
|
|
else
|
|
{
|
|
& $toolExecutable @("cloud", "-c", "-a")
|
|
}
|
|
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Error: 'nbgv cloud -c -a' failed with $($LastExitCode)."
|
|
}
|
|
|
|
# Set build environment version numbers in pipeline context
|
|
Write-Host "Setting version build variables:"
|
|
Write-Host "##vso[task.setvariable variable=Version_Full;isOutput=true]$($version.Full)"
|
|
Write-Host "##vso[task.setvariable variable=Version_Prefix;isOutput=true]$($version.Prefix)"
|