-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-release-pipelines.yml
92 lines (81 loc) · 2.74 KB
/
azure-release-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
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
89
90
91
92
trigger:
paths:
exclude:
- PxCoco/*
tags:
include:
- 'v.*'
pr: none
stages:
- stage: build_test_release
displayName: Build/Test/Release
variables:
solution: 'prx.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
jobs:
- job: build_test_release
timeoutInMinutes: 5
cancelTimeoutInMinutes: 1
displayName: Build/Test/Release
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
version: '5.0.x'
- powershell: |
# Remove /refs/tags (10 chars) and v. (2 chars) from checkout string
$ver = $env:BUILD_SOURCEBRANCH.remove(0, 12)
Write-Host "##vso[task.setvariable variable=Version]$ver"
displayName: 'Update version to Tag'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
- task: NuGetAuthenticate@0
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: '$(solution)'
selectOrConfig: 'config'
nugetConfigPath: NuGet.Config
- task: DotNetCoreCLI@2
displayName: Restore Tools
inputs:
command: custom
custom: tool
arguments: 'restore'
selectOrConfig: 'config'
nugetConfigPath: NuGet.Config
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '$(solution)'
arguments: '"/p:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration);Version=$(Version)" --no-restore'
- task: DotNetCoreCLI@2
displayName: Unit Test
inputs:
command: test
projects: '**/*Tests.csproj'
nobuild: true
arguments: '"/p:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration);Version=$(Version)" --no-restore'
- task: DotNetCoreCLI@2
displayName: Pack
inputs:
command: pack
searchPatternPack: 'Prexonite/Prexonite.csproj'
nobuild: true
configurationToPack: $(BuildConfiguration)
buildProperties: Platform=$(BuildPlatform);Version=$(Version)
- task: PublishPipelineArtifact@0
displayName: Publish to pipeline
condition: succeeded()
inputs:
artifactName: 'binaries'
targetPath: '$(Build.ArtifactStagingDirectory)'
- task: DotNetCoreCLI@2
displayName: Publish (NuGet)
condition: succeeded()
inputs:
command: push
publishVstsFeed: 'edge'