Skip to content

Bump actions/setup-dotnet from 2 to 4 #392

Bump actions/setup-dotnet from 2 to 4

Bump actions/setup-dotnet from 2 to 4 #392

Workflow file for this run

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@v4
- 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@v4
if: matrix.os == 'ubuntu-latest'
with:
name: nuget
path: |
SharpXMPP.Shared/bin/Release/*.nupkg
SharpXMPP.WebSocket/bin/Release/*.nupkg