-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (53 loc) · 1.9 KB
/
continuous-integration-workflow.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
59
60
61
62
63
64
65
66
67
68
name: .NET Core
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Fetch all history for all tags and branches
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x
- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
- name: coverlet
uses: b3b00/[email protected]
with:
testProject: tests/PlantUml.Builder.Tests/PlantUml.Builder.Tests.csproj
output: lcov.info
outputFormat: lcov
excludes: '[PlantUml.Builder.Tests]*'
- name: coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: tests/PlantUml.Builder.Tests/lcov.info
- name: Pack
run: dotnet pack -v normal --configuration Release --no-restore --include-symbols --include-source -p:PackageVersion=${{ steps.gitversion.outputs.NuGetVersion }} src/PlantUml.Builder/PlantUml.Builder.csproj
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nupkg
path: ./src/PlantUml.Builder/bin/Release/*.nupkg
- name: Push NuGet
if: ${{ github.ref == 'refs/heads/main' }}
run: dotnet nuget push ./src/PlantUml.Builder/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate