-
Notifications
You must be signed in to change notification settings - Fork 22
35 lines (30 loc) · 885 Bytes
/
publish.yaml
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
name: Publish
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Pack
run: dotnet pack -c Release -o ./nupkgs --no-build
- name: Publish
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_TOKEN }}
run: dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ env.NUGET_AUTH_TOKEN }} --skip-duplicate -s https://api.nuget.org/v3/index.json