Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nmangue authored Aug 4, 2024
1 parent b686cfd commit 1ad1f50
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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

0 comments on commit 1ad1f50

Please sign in to comment.