Skip to content

Build

Build #8

Workflow file for this run

name: Build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
publish:
description: 'Publish to NuGet'
required: true
type: boolean
default: false
jobs:
build-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Publish to NuGet
if: success() && (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
run: dotnet nuget push src/NGrib/bin/Release/NGrib.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate