-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.35 KB
/
dotnet.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
39
40
41
42
43
44
45
46
47
48
49
50
name: .NET
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ["6.0.x", "7.0.x", "8.0.x"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Perform a full clone to get the entire history
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: "5.x"
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack
run: dotnet pack --no-build -o ./nupkg
- name: Push NuGet package to GitHub
run: dotnet nuget push ./nupkg/*.nupkg --source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --api-key ${{ secrets.GH_TOKEN }}