Add minversion file generation to build output for downstream jobs
This commit is contained in:
parent
1bb0176c92
commit
335da52abf
1 changed files with 17 additions and 0 deletions
|
|
@ -85,6 +85,23 @@ build_windows:
|
||||||
}
|
}
|
||||||
& $dotnetExe restore
|
& $dotnetExe restore
|
||||||
& $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal
|
& $dotnetExe build "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -v minimal
|
||||||
|
# Write a minversion file into the build output so downstream jobs can read the computed version.
|
||||||
|
try {
|
||||||
|
$outRoot = Join-Path -Path "imagecatalog\bin\$env:BUILD_CONFIG" -ChildPath '*'
|
||||||
|
# search under the build output for a file starting with ImageCatalog.
|
||||||
|
$built = Get-ChildItem -Path (Join-Path "imagecatalog\bin\$env:BUILD_CONFIG" '.') -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.Name -like 'ImageCatalog.*' } | Select-Object -First 1
|
||||||
|
if ($built) {
|
||||||
|
$base = [System.IO.Path]::GetFileNameWithoutExtension($built.Name)
|
||||||
|
$version = $base -replace '^ImageCatalog\.', ''
|
||||||
|
$minPath = Join-Path $built.DirectoryName 'minversion'
|
||||||
|
Write-Host "Writing minversion '$version' to $minPath"
|
||||||
|
Set-Content -Path $minPath -Value $version -Encoding UTF8
|
||||||
|
} else {
|
||||||
|
Write-Host 'No ImageCatalog build artifact found to derive minversion from.'
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
Write-Host "Failed to write minversion: $_"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue