Skip to content

Publish to Nuget

Publish to Nuget #11

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Publish to Nuget
# Controls when the workflow will run
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore -p:NoWarn=CS1591
- name: Test
run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal
Publish:
runs-on: windows-latest
needs: [Tests]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore -p:NoWarn=CS1591
- name: Test Again
run: dotnet test -c Release --no-build --no-restore --verbosity normal
- name: Pack
run: dotnet pack -o publishOutput -c Release --no-restore --no-build --verbosity normal
# Runs a set of commands using the runners shell
- name: Push to Nuget
run: dotnet nuget push publishOutput\*.nupkg -k ${{ secrets.NUGET_UPDATEKEY }} -s https://api.nuget.org/v3/index.json