-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (67 loc) · 1.99 KB
/
Copy pathbuild.yml
File metadata and controls
73 lines (67 loc) · 1.99 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Build and Publish
on:
push:
branches:
- master
- release
pull_request:
branches:
- master
jobs:
build:
if: github.ref == 'refs/heads/master'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.300'
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.301'
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.101'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: |
dotnet test /p:CollectCoverage=true /p:CoverletOutput=../CoverageResults/ /p:MergeWith="../CoverageResults/coverage.json" /p:CoverletOutputFormat="lcov%2cjson" -m:1
cp CoverageResults/coverage.info .
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@master
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
path-to-lcov: coverage.info
publish:
if: github.ref == 'refs/heads/release'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.101'
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Pack
run: dotnet pack --configuration Release --output ./nupkgs
- name: List Package Files
run: dir ./nupkgs
- name: Publish to NuGet
shell: pwsh
run: |
Get-ChildItem -Path "./nupkgs/*.nupkg" | ForEach-Object {
dotnet nuget push $_.FullName --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
}