-
Notifications
You must be signed in to change notification settings - Fork 17
31 lines (28 loc) · 979 Bytes
/
nuget.yml
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
name: .NET nuget publish
on:
release:
types: released
jobs:
nugetpush:
name: Build, test and push to nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Add Github Packages source
run: dotnet nuget add source --username cmdotcom --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/cmdotcom/index.json"
- name: Publish to Github Packages
run: dotnet nuget push **/*.nupkg -s github
- name: Publish to Nuget.org
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.nuget_apikey }} -s https://api.nuget.org/v3/index.json