Bump actions/setup-dotnet from 2 to 4 #386
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET | |
on: | |
pull_request: | |
push: | |
branches: master | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Add msbuild to PATH | |
if: matrix.os == 'windows-latest' | |
uses: microsoft/setup-msbuild@v1.3 | |
- name: Build console app | |
run: dotnet build SharpXMPP.Console | |
- name: Build WPF app | |
if: matrix.os == 'windows-latest' | |
run: | | |
nuget restore SharpXMPP.sln | |
msbuild SharpXMPP.WPF/SharpXMPP.WPF.csproj /p:Configuration=Debug /t:Rebuild | |
- name: Build Xamarin apps | |
if: matrix.os == 'macos-latest' | |
run: | | |
nuget restore SharpXMPP.sln | |
msbuild SharpXMPP.Xamarin/SharpXMPP.Client.iOS/SharpXMPP.Client.iOS.csproj /p:Configuration=Debug /p:Platform=iPhoneSimulator /t:Rebuild | |
msbuild SharpXMPP.Xamarin/SharpXMPP.Client.Droid/SharpXMPP.Client.Droid.csproj /p:Configuration=Debug /t:PackageForAndroid | |
- name: Run .NET 5 tests | |
run: dotnet test SharpXMPP.NUnit -f net5.0 | |
- name: Configure Mono | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
echo "mono_path=/usr/lib/mono/4.5/" >> $GITHUB_ENV | |
- name: Build tests with .NET 4.8/Mono | |
if: matrix.os != 'macos-latest' | |
run: dotnet build SharpXMPP.NUnit --no-restore --configuration Release -f net48 | |
env: | |
FrameworkPathOverride: ${{ env.mono_path }} | |
- name: Run tests with .NET 4.8/Mono | |
if: matrix.os != 'macos-latest' | |
run: dotnet test SharpXMPP.NUnit --no-restore --no-build --configuration Release -f net48 | |
env: | |
FrameworkPathOverride: ${{ env.mono_path }} | |
- name: Build the SharpXMPP.Shared package | |
run: cd SharpXMPP.Shared && dotnet pack --configuration Release | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build the SharpXMPP.WebSocket package | |
run: cd SharpXMPP.WebSocket && dotnet pack --configuration Release | |
if: matrix.os == 'ubuntu-latest' | |
- name: Upload the NuGet packages | |
uses: actions/upload-artifact@v3 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
name: nuget | |
path: | | |
SharpXMPP.Shared/bin/Release/*.nupkg | |
SharpXMPP.WebSocket/bin/Release/*.nupkg |