From fdbee580df3dc9f481614d4bed116dd2e61fd2e7 Mon Sep 17 00:00:00 2001 From: Antonello Provenzano Date: Wed, 4 Sep 2024 19:48:10 +0200 Subject: [PATCH] Fixing the release pipeline script --- .github/workflows/release.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b00bd5..b841840 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,17 +30,20 @@ jobs: with: dotnet-version: ${{ matrix.dotnet }} - - name: Set the TFM for .NET 6.0 - if: matrix.dotnet == '6.0.x' - run: echo "DOTNET_TFM=net6.0" >> $GITHUB_ENV - - - name: Set the TFM for .NET 7.0 - if: matrix.dotnet == '7.0.x' - run: echo "DOTNET_TFM=net7.0" >> $GITHUB_ENV + - name: Set the TFM in Ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + VERSION=$(echo "${{ matrix.dotnet }}" | sed 's/[^0-9.]*//g') + VERSION=$(echo "${VERSION}" | sed 's/\.$//') + DOTNET_TFM="net${VERSION}" + echo "DOTNET_TFM=$DOTNET_TFM" >> $GITHUB_ENV - - name: Set the TFM for .NET 8.0 - if: matrix.dotnet == '8.0.x' - run: echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV + - name: Set the TFM in Windows + if: startsWith(matrix.os, 'windows') + run: | + $VERSION = "${{ matrix.dotnet }}".Substring(0, "${{ matrix.dotnet }}".LastIndexOf('.')) + $DOTNET_TFM = "net$VERSION" + echo "DOTNET_TFM=$DOTNET_TFM" | Out-File -FilePath $env:GITHUB_ENV -Append - name: Restore dependencies run: dotnet restore @@ -48,8 +51,13 @@ jobs: - name: Build run: dotnet build --no-restore -c Release /p:Version=$VERSION -f ${{ env.DOTNET_TFM }} - - name: Test - run: dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_TFM }} /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*" + - name: Test (Ubuntu) + if: startsWith(matrix.os, 'ubuntu-latest') + run: dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_TFM }} /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.XUnit]*" + + - name: Test (Windows) + if: startsWith(matrix.os, 'windows') + run: dotnet test --no-build --verbosity normal -c Release -f ${{ env.DOTNET_TFM }} --filter DB!=SQLServer - name: Collect to Codecov uses: codecov/codecov-action@v3