-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (58 loc) · 2.06 KB
/
publish.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
name: Publish Nuget Package
on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-z0-9]+'
env:
PROJECT_NAME: Serilog.Enrichers.ExceptionProperties
BUILD_CONFIGURATION: 'Release'
DOTNET_VERSION: '7.x.x'
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/[email protected]
- name: Get tag
id: slug
uses: gacts/[email protected]
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run dotnet build and package
- name: dotnet build and test
run: |
dotnet tool restore
dotnet paket restore
dotnet restore
dotnet build --configuration '${{ env.BUILD_CONFIGURATION }}' /p:Version=${{steps.slug.outputs.version}}
dotnet test --configuration '${{ env.BUILD_CONFIGURATION }}' /p:Version=${{steps.slug.outputs.version}}
publish:
needs: build
runs-on: ubuntu-latest
steps:
# Checkout the repo
- uses: actions/[email protected]
- name: Get tag
id: slug
uses: gacts/[email protected]
# Setup .NET Core SDK
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# Run dotnet build and package
- name: dotnet build and package
run: |
dotnet tool restore
dotnet paket restore
dotnet restore
dotnet build --configuration '${{ env.BUILD_CONFIGURATION }}' /p:Version=${{steps.slug.outputs.version}}
dotnet paket pack nugets --symbols
# Publish the package to Azure Artifacts
# NuGet repository API key is configured with .NET Core above, and the value provided here is ignored
- name: 'dotnet publish'
run: dotnet nuget push --api-key ${{secrets.NUGET_API_KEY}} -s nugets/${{env.PROJECT_NAME}}.${{steps.slug.outputs.version}}.symbols.nupkg