Skip to content

Target .NET 8 and updated NuGet packages #40

Target .NET 8 and updated NuGet packages

Target .NET 8 and updated NuGet packages #40

Workflow file for this run

name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- uses: nuget/setup-nuget@v1
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore src/Elmah.Io.Client.Extensions.SourceCode/Elmah.Io.Client.Extensions.SourceCode.csproj
- name: Test
run: dotnet test --no-restore
- name: Build FileSystem sample
run: dotnet build --no-restore .\samples\Elmah.Io.Client.Extensions.SourceCode.FileSystem
- name: Build Pdb sample
run: dotnet build --no-restore .\samples\Elmah.Io.Client.Extensions.SourceCode.PdbSample
- name: Restore .NET Framework sample
run: nuget restore Elmah.Io.Client.Extensions.SourceCode.sln
- name: Build .NET Framework sample
run: msbuild .\samples\Elmah.Io.Client.Extensions.SourceCode.NetFrameworkPdb\Elmah.Io.Client.Extensions.SourceCode.NetFrameworkPdb.csproj
- name: Pack
run: dotnet pack --configuration Release src/Elmah.Io.Client.Extensions.SourceCode/Elmah.Io.Client.Extensions.SourceCode.csproj /p:Version=5.1.${{ github.run_number }}-pre
- name: Install dotnet-validate
run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.304
- name: Validate
run: dotnet-validate package local src/Elmah.Io.Client.Extensions.SourceCode/bin/Release/Elmah.Io.Client.Extensions.SourceCode.5.1.${{ github.run_number }}-pre.nupkg
- name: Push
run: dotnet nuget push src/Elmah.Io.Client.Extensions.SourceCode/bin/Release/Elmah.Io.Client.Extensions.SourceCode.5.1.${{ github.run_number }}-pre.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
if: ${{ github.event_name == 'push' }}