-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 980 Bytes
/
main.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
32
33
34
35
36
37
38
name: Deploy NuGet Package
env:
PROJECT_PATH: './Pandatech.Crypto/Pandatech.Crypto.csproj'
OUTPUT_DIR: 'nupkgs'
NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
on:
push:
branches:
- main
jobs:
deploy:
runs-on: self-hosted
strategy:
matrix:
dotnet-version: [ '8.x.x' ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Build
run: dotnet build ${{ env.PROJECT_PATH }}
- name: Test
run: dotnet test ${{ env.PROJECT_PATH }} --collect:"XPlat Code Coverage"
- name: Pack
run: dotnet pack ${{ env.PROJECT_PATH }} --output ${{ env.OUTPUT_DIR }}
- name: Publish
run: dotnet nuget push ${{ env.OUTPUT_DIR }}/*.nupkg -k ${{ env.NUGET_API_KEY }} -s ${{ env.NUGET_SOURCE }}