Skip to content

Commit

Permalink
Add action to publish NuGet package on release (#18)
Browse files Browse the repository at this point in the history
* Add action to publish NuGet package on release

* remove push trigger
  • Loading branch information
spkl authored May 5, 2024
1 parent 9436363 commit efc9152
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish NuGet Package

on:
release:
types: [ published ]
workflow_dispatch:

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack src/Diffs.csproj /p:ContinuousIntegrationBuild=true --output .
- name: Publish
shell: bash
env:
API_KEY: ${{ secrets.NUGET_ORG_API_KEY }}
run: |
dotnet nuget push "*.nupkg" --api-key "$API_KEY" --source https://api.nuget.org/v3/index.json

0 comments on commit efc9152

Please sign in to comment.