66 - ' *'
77 pull_request :
88
9+ concurrency :
10+ group : ci-build-release-lock
11+ cancel-in-progress : true
12+
913jobs :
14+ prepare :
15+ name : Prepare compile matrix
16+ runs-on : windows-2022
17+ outputs :
18+ versions : ${{ steps.versions.outputs.versions }}
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+
23+ - name : Read versions from Directory.Build.props
24+ id : versions
25+ shell : pwsh
26+ run : |
27+ [xml]$props = Get-Content "source/Directory.Build.props"
28+ $configEntries = @()
29+ foreach ($node in @($props.Project.PropertyGroup.Configurations)) {
30+ if ($null -ne $node -and -not [string]::IsNullOrWhiteSpace($node.InnerText)) {
31+ $configEntries += ($node.InnerText -split ';')
32+ }
33+ }
34+
35+ $versions = @()
36+ foreach ($entry in $configEntries) {
37+ $trimmed = $entry.Trim()
38+ if ($trimmed -match '^Release\s+(R\d+)$') {
39+ $versions += $Matches[1]
40+ }
41+ }
42+
43+ $versions = $versions | Sort-Object -Unique
44+ if ($versions.Count -eq 0) {
45+ throw "No Release Rxx configurations found in source/Directory.Build.props"
46+ }
47+
48+ $versionsJson = $versions | ConvertTo-Json -Compress
49+ "versions=$versionsJson" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
50+
1051 compile :
11- name : Compile
52+ needs : prepare
53+ name : Compile ${{ matrix.version }}
1254 runs-on : windows-2022
55+ strategy :
56+ fail-fast : false
57+ matrix :
58+ version : ${{ fromJson(needs.prepare.outputs.versions) }}
1359 steps :
1460 - name : Checkout
1561 uses : actions/checkout@v4
2066 path : |
2167 .nuke/temp
2268 ~/.nuget/packages
23- key : ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
69+ key : ${{ runner.os }}-${{ matrix.version }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
2470
2571 - name : Compile solution
26- run : ./.nuke/build.cmd
72+ run : ./.nuke/build.cmd --configurations "Release ${{ matrix.version }}"
0 commit comments