Skip to content

update(workflows): enhance CI workflows with concurrency and version … #86

update(workflows): enhance CI workflows with concurrency and version …

update(workflows): enhance CI workflows with concurrency and version … #86

Workflow file for this run

name: Compile
on:
push:
branches:
- '*'
pull_request:
concurrency:
group: ci-build-release-lock
cancel-in-progress: true
jobs:
prepare:
name: Prepare compile matrix
runs-on: windows-2022
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read versions from Directory.Build.props
id: versions
shell: pwsh
run: |
[xml]$props = Get-Content "source/Directory.Build.props"
$configEntries = @()
foreach ($node in @($props.Project.PropertyGroup.Configurations)) {
if ($null -ne $node -and -not [string]::IsNullOrWhiteSpace($node.InnerText)) {
$configEntries += ($node.InnerText -split ';')
}
}
$versions = @()
foreach ($entry in $configEntries) {
$trimmed = $entry.Trim()
if ($trimmed -match '^Release\s+(R\d+)$') {
$versions += $Matches[1]
}
}
$versions = $versions | Sort-Object -Unique
if ($versions.Count -eq 0) {
throw "No Release Rxx configurations found in source/Directory.Build.props"
}
$versionsJson = $versions | ConvertTo-Json -Compress
"versions=$versionsJson" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
compile:
needs: prepare
name: Compile ${{ matrix.version }}
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.prepare.outputs.versions) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache packages
uses: actions/cache@v4
with:
path: |
.nuke/temp
~/.nuget/packages
key: ${{ runner.os }}-${{ matrix.version }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: Compile solution
run: ./.nuke/build.cmd --configurations "Release ${{ matrix.version }}"