name: .NET

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ${{ matrix.os }} 
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]

    steps:
    - uses: actions/checkout@v2
      
    - name: Setup .NET Core 2.1
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.1.803
  
    - name: Setup .NET Core 3.1
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.101
      
    - name: Setup .NET 5
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '5.0.100'

    - name: Restore dependencies
      run: dotnet restore

    - name: Build
      run: dotnet build --no-restore

    - name: Test
      run: dotnet test --verbosity normal
      
  package:
    runs-on: windows-latest
    
    steps:
    - name: Publish RazorLight
      uses: brandedoutcast/publish-nuget@v2.5.5
      with:
          PROJECT_FILE_PATH: src/RazorLight/RazorLight.csproj
          NUGET_KEY: ${{secrets.NUGET_API_KEY}}
  

name: .NET

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ${{ matrix.os }} 
    strategy:
      matrix:
        os: [windows-latest, ubuntu-latest, macos-latest]

    steps:
    - uses: actions/checkout@v2
      
    - name: Setup .NET Core 2.1
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 2.1.803
  
    - name: Setup .NET Core 3.1
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.101
      
    - name: Setup .NET 5
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: '5.0.100'

    - name: Restore dependencies
      run: dotnet restore

    - name: Build
      run: dotnet build --no-restore

    - name: Test
      run: dotnet test --verbosity normal
      

Move logic to separate workflow file
Move logic to separate workflow file