This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
62 lines (56 loc) · 1.71 KB
/
azure-pipelines.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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
tags:
include:
- v*
branches:
include:
- master
- dev
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
variables:
buildConfiguration: 'Release'
tagVersion: ${{ replace(variables['Build.SourceBranch'], 'refs/tags/v', '') }}
steps:
- task: DotNetCoreCLI@2
inputs:
command: restore
displayName: 'dotnet restore'
- task: DotNetCoreCLI@2
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration $(buildConfiguration)'
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/*Tests/*.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
displayName: 'dotnet test $(buildConfiguration)'
- task: DotNetCoreCLI@2
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
command: pack
projects: '**/*.csproj'
arguments: '-o ./bin -c $(buildConfiguration)'
displayName: 'Packing Base64'
- task: DotNetCoreCLI@2
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
command: push
arguments: './bin/Base64Enc.$(tagVersion).nupkg --source https://api.nuget.org/v3/index.json --api-key $(nuget-api-key)'
displayName: 'Publishing to NuGet'