From f90c0e6ecd1701aa3e34a2516702949a628b9a98 Mon Sep 17 00:00:00 2001 From: Giorgi Svanadze Date: Thu, 12 Mar 2026 18:58:25 +0400 Subject: [PATCH] fix workflows --- .github/workflows/main.yml | 27 +++++++++++++-------- .github/workflows/nuget.yml | 8 +++++- examples/UsageExample3/UsageExample3.csproj | 4 +-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e72468..96e4bf2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,7 +52,7 @@ jobs: run: | set -e echo "Finding SDK-style projects..." - mapfile -t sdk_projects < <(grep -rl --null --exclude-dir:packages 'true' "$proj" 2>/dev/null || echo "$proj" | grep -qi 'test'; then echo "Testing $proj" @@ -99,19 +99,26 @@ jobs: - name: Setup NuGet CLI uses: NuGet/setup-nuget@v1 + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + - name: Restore packages.config packages (NuGet) run: | - nuget restore + $ErrorActionPreference = 'Stop' + $sln = (Get-ChildItem -Path . -Filter *.sln -Recurse | Select-Object -First 1).FullName + if (-not $sln) { throw "No solution file found." } + nuget restore $sln -PackagesDirectory .\packages -NonInteractive - - name: Restore & build all projects (including legacy) + - name: Build legacy non-SDK projects with MSBuild run: | $ErrorActionPreference = 'Stop' - $csprojs = Get-ChildItem -Recurse -Filter *.csproj | Select-Object -ExpandProperty FullName - foreach ($p in $csprojs) { - Write-Host "Restoring $p" - dotnet restore $p -p:Configuration=Release - Write-Host "Building $p" - dotnet build $p -c Release --no-restore + $legacyProjects = Get-ChildItem -Recurse -Filter *.csproj | Where-Object { + -not (Select-String -Path $_.FullName -Pattern ' - ..\..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll - + ..\..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll +