Skip to content

Commit

Permalink
Fixed compilation to .NET 8 when .NET 9 is used as SDK in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Nov 16, 2024
1 parent adcdfac commit 512523c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,56 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ "8", "9" ]
framework: [ "net8.0", "net9.0" ]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
dotnet-version: "9.x"
- name: List installed SDKs
run: dotnet --list-sdks
- name: Restore dependencies
run: dotnet restore
run: dotnet restore -f ${{ matrix.framework }}
- name: Build
run: dotnet build --no-restore -f net${{ matrix.dotnet }}.0
run: dotnet build --no-restore -f ${{ matrix.framework }}
- name: Test
run: dotnet test --no-build --verbosity normal -f net${{ matrix.dotnet }}.0
run: dotnet test --no-build --verbosity normal -f ${{ matrix.framework }}
- name: Publish Linux (arm64/x64)
run: |
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f net${{ matrix.dotnet }}.0 -r linux-x64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f net${{ matrix.dotnet }}.0 -r linux-arm64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f ${{ matrix.framework }} -r linux-x64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f ${{ matrix.framework }} -r linux-arm64 --nologo --self-contained
- name: Upload Linux Builds
uses: actions/upload-artifact@v4
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
with:
name: linux-builds-dotnet-${{ matrix.dotnet }}
path: |
${{ github.workspace }}/src/bin/Release/net${{ matrix.dotnet }}.0/linux-x64/publish/
${{ github.workspace }}/src/bin/Release/net${{ matrix.dotnet }}.0/linux-arm64/publish/
${{ github.workspace }}/src/bin/Release/${{ matrix.framework }}/linux-x64/publish/
${{ github.workspace }}/src/bin/Release/${{ matrix.framework }}/linux-arm64/publish/
- name: Publish OSX (arm64/x64)
run: |
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f net${{ matrix.dotnet }}.0 -r osx-x64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f net${{ matrix.dotnet }}.0 -r osx-arm64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f ${{ matrix.framework }} -r osx-x64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f ${{ matrix.framework }} -r osx-arm64 --nologo --self-contained
- name: Upload OSX Builds
uses: actions/upload-artifact@v4
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
with:
name: osx-builds-dotnet-${{ matrix.dotnet }}
path: |
${{ github.workspace }}/src/bin/Release/net${{ matrix.dotnet }}.0/osx-x64/publish/
${{ github.workspace }}/src/bin/Release/net${{ matrix.dotnet }}.0/osx-arm64/publish/
${{ github.workspace }}/src/bin/Release/${{ matrix.framework }}/osx-x64/publish/
${{ github.workspace }}/src/bin/Release/${{ matrix.framework }}/osx-arm64/publish/
- name: Publish Windows (arm64/x64)
run: |
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f net${{ matrix.dotnet }}.0 -r win-x64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f net${{ matrix.dotnet }}.0 -r win-arm64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f ${{ matrix.framework }} -r win-x64 --nologo --self-contained
dotnet publish src/SteamCollectionDownloadSizeCalculator.csproj -c Release -f ${{ matrix.framework }} -r win-arm64 --nologo --self-contained
- name: Upload Windows Builds
uses: actions/upload-artifact@v4
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
with:
name: windows-builds-dotnet-${{ matrix.dotnet }}
path: |
${{ github.workspace }}/src/bin/Release/net${{ matrix.dotnet }}.0/win-x64/publish/
${{ github.workspace }}/src/bin/Release/net${{ matrix.dotnet }}.0/win-arm64/publish/
${{ github.workspace }}/src/bin/Release/${{ matrix.framework }}/win-x64/publish/
${{ github.workspace }}/src/bin/Release/${{ matrix.framework }}/win-arm64/publish/

0 comments on commit 512523c

Please sign in to comment.