Skip to content

Commit

Permalink
Create nuget-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak authored Jun 27, 2024
1 parent 7f30d49 commit 2cefb2d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish NuGet Package
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Restore dependencies
run: dotnet restore

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

- name: Run tests
run: dotnet test --no-restore --verbosity normal

- name: Pack NuGet package
run: dotnet pack --configuration Release --no-build --output ./nupkg src/MediatR.MinimalApi/MediatR.MinimalApi.csproj

- name: Publish NuGet package
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 2cefb2d

Please sign in to comment.