-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (36 loc) · 1.43 KB
/
nuget-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
36
37
38
39
40
41
42
43
44
45
46
47
name: Publish nuget
on:
push:
branches: [ "master" ]
env:
working-directory: Sources
release-directory: ./artifacts/package/release
dotnet-version: 8.0.x
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
working-directory: ${{ env.working-directory }}
- name: Build
run: dotnet build -c Release /p:ContinuousIntegrationBuild=true --no-restore --verbosity normal
working-directory: ${{ env.working-directory }}
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
working-directory: ${{ env.working-directory }}
- name: Pack
run: dotnet pack --no-build
working-directory: ${{ env.working-directory }}
- name: Publish to Nuget
run: dotnet nuget push ${{ env.release-directory }}/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
working-directory: ${{ env.working-directory }}
- name: Publish to Nuget symbols
run: dotnet nuget push ${{ env.release-directory }}/*.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
working-directory: ${{ env.working-directory }}