-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (28 loc) · 882 Bytes
/
main.yml
File metadata and controls
36 lines (28 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Publish NuGet Package
on:
push:
branches:
- main
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: '9.0.x' # Specify the .NET version you're using
- name: Build and Test
run: |
dotnet restore
dotnet build --configuration Release
dotnet test --no-build --configuration Release
- name: Pack
run: dotnet pack --no-build --configuration Release --output nupkgs
- name: Publish
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: dotnet nuget push nupkgs/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ env.NUGET_API_KEY }}
- name: Clean up
run: rm -rf nupkgs