diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e6e233a..c938b0e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -27,29 +27,43 @@ jobs: with: dotnet-version: ${{ matrix.dotnet }} - - name: Set the TFM for .NET 6.0 in Ubuntu - if: matrix.dotnet == '6.0.x' && startsWith(matrix.os, 'ubuntu') - run: echo "DOTNET_TFM=net6.0" >> $GITHUB_ENV + - name: Set the TFM in Ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + VERSION=$(echo "${{ matrix.dotnet }}" | sed 's/[^0-9.]*//g') + DOTNET_TFM=".net${VERSION}" + echo "DOTNET_TFM=$DOTNET_TFM" >> $GITHUB_ENV - - name: Set the TFM for .NET 6.0 in Windows - if: matrix.dotnet == '6.0.x' && startsWith(matrix.os, 'windows') - run: echo "DOTNET_TFM=net6.0" | Out-File -FilePath $env:GITHUB_ENV -Append + - name: Set the TFM in Windows + if: startsWith(matrix.os, 'windows') + run: | + $VERSION = ${{ matrix.dotnet }} -replace '[^0-9.]', '' + $DOTNET_TFM = ".net$VERSION" + echo "DOTNET_TFM=$DOTNET_TFM" | Out-File -FilePath $env:GITHUB_ENV -Append - - name: Set the TFM for .NET 7.0 in Ubuntu - if: matrix.dotnet == '7.0.x' && startsWith(matrix.os, 'ubuntu') - run: echo "DOTNET_TFM=net7.0" >> $GITHUB_ENV + # - name: Set the TFM for .NET 6.0 in Ubuntu + # if: matrix.dotnet == '6.0.x' && startsWith(matrix.os, 'ubuntu') + # run: echo "DOTNET_TFM=net6.0" >> $GITHUB_ENV - - name: Set the TFM for .NET 7.0 in Windows - if: matrix.dotnet == '7.0.x' && startsWith(matrix.os, 'windows') - run: echo "DOTNET_TFM=net7.0" | Out-File -FilePath $env:GITHUB_ENV -Append + # - name: Set the TFM for .NET 6.0 in Windows + # if: matrix.dotnet == '6.0.x' && startsWith(matrix.os, 'windows') + # run: echo "DOTNET_TFM=net6.0" | Out-File -FilePath $env:GITHUB_ENV -Append - - name: Set the TFM for .NET 8.0 in Ubuntu - if: matrix.dotnet == '8.0.x' && startsWith(matrix.os, 'ubuntu') - run: echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV + # - name: Set the TFM for .NET 7.0 in Ubuntu + # if: matrix.dotnet == '7.0.x' && startsWith(matrix.os, 'ubuntu') + # run: echo "DOTNET_TFM=net7.0" >> $GITHUB_ENV - - name: Set the TFM for .NET 8.0 in Windows - if: matrix.dotnet == '8.0.x' && startsWith(matrix.os, 'windows') - run: echo "DOTNET_TFM=net8.0" | Out-File -FilePath $env:GITHUB_ENV -Append + # - name: Set the TFM for .NET 7.0 in Windows + # if: matrix.dotnet == '7.0.x' && startsWith(matrix.os, 'windows') + # run: echo "DOTNET_TFM=net7.0" | Out-File -FilePath $env:GITHUB_ENV -Append + + # - name: Set the TFM for .NET 8.0 in Ubuntu + # if: matrix.dotnet == '8.0.x' && startsWith(matrix.os, 'ubuntu') + # run: echo "DOTNET_TFM=net8.0" >> $GITHUB_ENV + + # - name: Set the TFM for .NET 8.0 in Windows + # if: matrix.dotnet == '8.0.x' && startsWith(matrix.os, 'windows') + # run: echo "DOTNET_TFM=net8.0" | Out-File -FilePath $env:GITHUB_ENV -Append - name: Restore dependencies run: dotnet restore