-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (39 loc) · 1.61 KB
/
dotnetcore.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
name: .NET Core
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.207
- name: clean
run: dotnet clean -c Release
- name: build
run: dotnet build
- name: test
run: |
dotnet tool install -g coverlet.console
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=../opencover.xml ./Cashwu.Core.DateTime.Tests/Cashwu.Core.DateTime.Tests.csproj
- name: upload coverage to codecov
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./opencover.xml
flags: unittests
name: Cashwu.Core.DateTime
- name: generate build number
if: github.ref == 'refs/heads/master' && contains(toJson(github.event.commits), '[update]') == true
uses: einaregilsson/build-number@v2
with:
token: ${{secrets.github_token}}
- name: dotnet pack
if: github.ref == 'refs/heads/master' && contains(toJson(github.event.commits), '[update]') == true
run: dotnet pack ./Cashwu.Core.DateTime/Cashwu.Core.DateTime.csproj -c Release -o ../release -p:PackageVersion=1.0.$BUILD_NUMBER
- name: nuget publish
if: github.ref == 'refs/heads/master' && contains(toJson(github.event.commits), '[update]') == true
continue-on-error: true
run: |
dotnet nuget push ./release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json