From 94c42dfde493bf129f74226b05c922b6cfa98109 Mon Sep 17 00:00:00 2001 From: Henrique <999396+hjgraca@users.noreply.github.com> Date: Fri, 7 Mar 2025 17:19:32 +0000 Subject: [PATCH] feat(workflows): update .NET version setup to support multiple versions and improve package handling --- .../publish-artifacts-examples-tests.yml | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish-artifacts-examples-tests.yml b/.github/workflows/publish-artifacts-examples-tests.yml index bd2f53de..5267a78c 100644 --- a/.github/workflows/publish-artifacts-examples-tests.yml +++ b/.github/workflows/publish-artifacts-examples-tests.yml @@ -32,7 +32,9 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0 with: - dotnet-version: '8.x' + dotnet-version: | + 6.0.x + 8.0.x - name: Build libraries run: dotnet build ./libraries/ --configuration Release @@ -61,7 +63,9 @@ jobs: - name: Set up .NET uses: actions/setup-dotnet@3951f0dfe7a07e2313ec93c75700083e2005cbab # 4.3.0 with: - dotnet-version: '8.x' + dotnet-version: | + 6.0.x + 8.0.x - name: Download packages uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # 4.1.9 @@ -73,6 +77,11 @@ jobs: run: | dotnet nuget add source ${{ github.workspace }}/packages --name local + # Ensure we preserve access to NuGet.org + - name: Configure NuGet.org source + run: | + dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org + - name: Update examples to use local packages run: | find ./examples -name "*.csproj" | while read project; do @@ -81,17 +90,21 @@ jobs: # Extract package name and version packageName=$(basename $package .nupkg | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+.*)$/\1/') packageVersion=$(basename $package .nupkg | sed -E 's/(.*)\.([0-9]+\.[0-9]+\.[0-9]+.*)$/\2/') - - # Use xmlstarlet to check and update package references + + # Check if project references this package if grep -q "