Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tringler committed Jun 20, 2024
2 parents d1d6f0f + 216ef26 commit 55635c9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish NuGet Package

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

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.5'

- name: Restore dependencies
run: dotnet restore

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

- name: Pack
run: dotnet pack --configuration Release --no-build --output ./nupkg

- name: Publish to NuGet
if: github.ref == 'refs/heads/main' # Only publish from the main branch
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json

0 comments on commit 55635c9

Please sign in to comment.