-
-
Notifications
You must be signed in to change notification settings - Fork 22
35 lines (26 loc) · 997 Bytes
/
test.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
name: Build, Test, and Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run tests
run: dotnet test --no-build --configuration Release
- name: Pack
run: dotnet pack --no-build --configuration Release --output ./nupkg
- name: Publish to NuGet
if: startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
- name: Publish to GitHub Packages
if: startsWith(github.ref, 'refs/tags/')
run: dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.GPM_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json