-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.15 KB
/
Copy pathbuild-test-publish.yml
File metadata and controls
51 lines (42 loc) · 1.15 KB
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
48
49
50
51
name: Build, Test, Publish
on:
push:
branches:
- master
pull_request:
branches:
- master
defaults:
run:
working-directory: src
jobs:
build-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Run Tests
run: dotnet test -c Release --no-restore --no-build -v normal
- name: Pack NuGet Package(s)
run: dotnet pack -c Release --no-restore --no-build --output ~/nuget-packages
- name: Upload Build Artifact(s)
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: ~/nuget-packages
- name: Push NuGet Package(s)
run: |
dotnet nuget push ~/nuget-packages/*.nupkg \
--source https://api.nuget.org/v3/index.json \
--api-key ${{ secrets.NUGET_API_KEY }} \
--skip-duplicate