diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0ccef7..f13eb57 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,6 +85,23 @@ build_windows: } & $dotnetExe restore & $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: paths: