-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (39 loc) · 1.4 KB
/
publish_package.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
name: .NET Core Desktop
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
SourceDir: ./src/
Configuration: Release
Framework: netstandard2.0
Solution_Path: ./src/Extended.Collections.sln
Library_Dir: ./src/Extended.Collections/
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore Dotnet Tools
run: dotnet tool restore
- name: Run Git Version
run: dotnet gitversion /output buildserver
- name: Restore
run: dotnet restore ${Solution_Path} -p:NoRestore=false
- name: Build
run: dotnet build ${Solution_Path} -p:Version=${{env.GitVersion_AssemblySemVer}}
- name: Execute unit tests
run: dotnet test ${Solution_Path} --no-build -p:CollectCoverage=true --collect:"XPlat Code Coverage"
# - name: Generate Code Coverage
# run: dotnet coverlet ${Library_Dir}bin/${Configuration}/${Framework}/Extended.Collections.dll
- name: Pack
run: dotnet msbuild -t:pack ${Solution_Path} -p:PackageVersion=${{env.GitVersion_NuGetVersion}} -p:NoBuild=true
- name: Push
run: dotnet nuget push ${Library_Dir}bin/${Configuration}/*.nupkg --skip-duplicate --api-key ${{secrets.NuGet_Api_Key}} --source ${{vars.Nuget_Source_Url}}