-
-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (75 loc) · 1.91 KB
/
release.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build and Publish
on:
push:
# branches:
# - main
tags:
- '*'
paths-ignore:
- README.md
- LICENSE
- CHANGELOG.md
- docs/**
jobs:
Build:
runs-on: ubuntu-latest
env:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
source-url: https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '6'
- name: Install dependencies
run: dotnet restore
- name: Build
run: >
dotnet build
--configuration $buildConfiguration
--no-restore
- name: Test
run: >
dotnet test
--configuration $buildConfiguration
--no-build
--verbosity normal
--collect "Code coverage"
- name: Pack
run: >
dotnet pack
--configuration $buildConfiguration
--no-build
--verbosity normal
--output $GITHUB_WORKSPACE/drop
-p:PackageVersion=$GITVERSION_NUGETVERSION
- name: Publish Artifact
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/drop/*
name: drop
- name: Publish to NuGet.org
if: startsWith(github.ref, 'refs/tags/')
run: >
dotnet nuget push "$GITHUB_WORKSPACE/drop/*"
-k ${{ secrets.NUGET_API_KEY }}
--skip-duplicate