-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (49 loc) · 1.26 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
51
52
53
54
55
56
57
58
name: Build and package
on:
push:
paths-ignore:
- 'docs/**'
branches:
- main
- release/**
tags:
- "*"
pull_request:
branches: [main]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
8.0.x
- name: Build packages
shell: pwsh
run: |
./build.ps1 -Output ./artifacts -CurrentBranch $Env:GITHUB_REF_NAME
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Publish build artifacts
uses: actions/upload-artifact@v4
with:
name: Packages
path: |
./artifacts/*.nupkg
- name: Publish to nuget
if: github.ref_name == 'main' || startsWith(github.ref, 'refs/tags/')
shell: pwsh
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
run: |
dotnet nuget push "./artifacts/*.nupkg" -k $Env:NUGET_KEY -s https://api.nuget.org/v3/index.json