1111 workflow_dispatch :
1212
1313env :
14- # Disable the .NET logo in the console output.
1514 DOTNET_NOLOGO : true
16- # Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
1715 DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
18- # Disable sending .NET CLI telemetry to Microsoft.
1916 DOTNET_CLI_TELEMETRY_OPTOUT : true
20- # Set the build number in MinVer.
21- MINVERBUILDMETADATA : build.${{github.run_number}}
17+ MINVERBUILDMETADATA : build.${{ github.run_number }}
2218
2319jobs :
2420 build :
25- name : pipeline-${{matrix.os}}-dotnet-${{matrix.dotnet-version}}
26- runs-on : ${{matrix.os}}
21+ name : pipeline-${{ matrix.os }}-dotnet-${{ matrix.dotnet-version }}
22+ runs-on : ${{ matrix.os }}
2723
2824 services :
2925 hivemq :
@@ -41,33 +37,43 @@ jobs:
4137
4238 strategy :
4339 matrix :
44- # Docker containers not supported on windows and macOS in Github runners.
45- # os: [ubuntu-latest, windows-latest, macOS-latest]
4640 os : [ubuntu-latest]
47- dotnet-version : ['6.0.x', '7.0.x', '8.0.x']
41+ dotnet-version : ['6.0.x', '7.0.x', '8.0.x', '9.0.x' ]
4842 steps :
49- - name : " Checkout"
43+ - name : Checkout
5044 uses : actions/checkout@v4.2.2
5145 with :
5246 lfs : true
5347 fetch-depth : 0
54- - name : " Install .NET Core SDK"
48+
49+ - name : Install .NET Core SDK
5550 uses : actions/setup-dotnet@v4
5651 with :
5752 dotnet-version : ' ${{ matrix.dotnet-version }}'
58- - name : " Dotnet Tool Restore"
53+
54+ - name : List Installed SDKs
55+ run : dotnet --list-sdks
56+
57+ - name : Create temporary global.json
58+ run : echo '{"sdk":{"version":"${{ matrix.dotnet-version }}"}}' > global.json
59+
60+ - name : Dotnet Tool Restore
5961 run : dotnet tool restore
6062 shell : pwsh
61- - name : " Dotnet Cake Build"
63+
64+ - name : Dotnet Cake Build
6265 run : dotnet cake --target=Build
6366 shell : pwsh
64- - name : " Dotnet Cake Test"
65- run : dotnet cake --target=Test
67+
68+ - name : Dotnet Cake Test
69+ run : dotnet cake --target=Test --framework net${{ matrix.dotnet-version }}
6670 shell : pwsh
67- - name : " Dotnet Cake Pack"
71+
72+ - name : Dotnet Cake Pack
6873 run : dotnet cake --target=Pack
6974 shell : pwsh
70- - name : " Upload NuGet packages"
75+
76+ - name : Upload NuGet packages
7177 uses : actions/upload-artifact@v4
7278 with :
7379 name : nuget-packages-${{ matrix.dotnet-version }}
@@ -77,22 +83,30 @@ jobs:
7783 needs : build
7884 runs-on : ubuntu-latest
7985 steps :
80- - name : " Download NuGet packages"
86+ - name : Download NuGet packages for .NET 6.0
8187 uses : actions/download-artifact@v4
8288 with :
8389 name : nuget-packages-6.0.x
8490 path : ./Artifacts
85- - name : " Download NuGet packages"
91+
92+ - name : Download NuGet packages for .NET 7.0
8693 uses : actions/download-artifact@v4
8794 with :
8895 name : nuget-packages-7.0.x
8996 path : ./Artifacts
90- - name : " Download NuGet packages"
97+
98+ - name : Download NuGet packages for .NET 8.0
9199 uses : actions/download-artifact@v4
92100 with :
93101 name : nuget-packages-8.0.x
94102 path : ./Artifacts
95103
104+ - name : Download NuGet packages for .NET 9.0
105+ uses : actions/download-artifact@v4
106+ with :
107+ name : nuget-packages-9.0.x
108+ path : ./Artifacts
109+
96110 - name : Push to NuGet
97111 if : github.event_name == 'release'
98112 run : dotnet nuget push ./Artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
0 commit comments