name: Build and Test

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

jobs:
  build:

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
        dotnet: [6.0.401]
        node: ['14']
    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2
    - name: Setup node
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node }}
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: ${{ matrix.dotnet }}
    - name: Install local tools
      run: dotnet tool restore
    - name: Paket Restore
      run: dotnet paket restore
    - name: Build and Test
      run: dotnet fake run build.fsx
    - name: Publish NuGet
      if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/master'
      run: dotnet fake run build.fsx -t PublishCINuGet
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Build and Test

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master
  workflow_dispatch:
    inputs:
      release:
        description: 'Release NuGet package'
        required: true
        default: false
        type: boolean

jobs:
  build:

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
        dotnet: [6.0.401]
        node: ['14']
    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2
    - name: Setup node
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node }}
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: ${{ matrix.dotnet }}
    - name: Install local tools
      run: dotnet tool restore
    - name: Paket Restore
      run: dotnet paket restore
    - name: Build and Test
      run: dotnet fake run build.fsx
    - name: Publish prerelease NuGet to GitHub
      if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/master' && (github.event.inputs.release == null || github.event.inputs.release == 'false')
      run: dotnet fake run build.fsx -t PublishCINuGet
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: Publish NuGet to NuGet.org
      if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/master' && github.event.inputs.release == 'true'
      run: dotnet fake run build.fsx -t Release
      env:
        NUGET_KEY: ${{ secrets.NUGETKEY }}
Add release NuGet publish from CI
Add release NuGet publish from CI
