-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
93 lines (91 loc) · 2.76 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
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
93
trigger:
branches:
include:
- '*'
tags:
include:
- '*'
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
MINVERBUILDMETADATA: build.$(Build.BuildId)
stages:
- stage: Build
jobs:
- job: Build
pool: $(BuildPool)
timeoutInMinutes: 10
steps:
- task: DeleteFiles@1
inputs:
contents: |
$(Agent.BuildDirectory)
- checkout: self
lfs: true
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
packageType: 'sdk'
useGlobalJson: true
- pwsh: 'dotnet tool restore'
displayName: 'Dotnet Tool Restore'
failOnStderr: true
- pwsh: 'dotnet cake --target=Build'
displayName: 'Dotnet Cake Build'
failOnStderr: true
- pwsh: 'dotnet cake --target=Test'
displayName: 'Dotnet Cake Test'
failOnStderr: true
- pwsh: 'dotnet cake --target=Pack'
displayName: 'Dotnet Cake Pack'
failOnStderr: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: '**/*.cobertura.xml'
- publish: './Artifacts'
artifact: 'publish'
displayName: 'Publish Artifacts'
- stage: Deploy
jobs:
- deployment: AzureArtifacts
displayName: 'Azure Artifacts'
condition: ne(variables['Build.Reason'], 'PullRequest')
pool: $(BuildPool)
environment: 'Build'
variables:
- group: Sholo Azure Artifacts
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@1
displayName: 'NuGet Install'
- task: NuGetAuthenticate@0
displayName: 'NuGet Authenticate'
- pwsh: dotnet nuget push $(Agent.BuildDirectory)/publish/*.nupkg --source $(AzureArtifactsSource) --api-key AzureArtifacts --skip-duplicate
displayName: 'NuGet Push'
failOnStderr: true
- deployment: NuGet
condition: and(ne(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.sourceBranch'], 'refs/tags/'))
pool: $(BuildPool)
environment: 'Build'
variables:
- group: Sholo NuGet
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet'
- pwsh: |
Get-ChildItem $(Agent.BuildDirectory)\publish -Filter *.nupkg |
Where-Object { !$_.Name.Contains('preview') } |
ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --api-key $(NuGetApiKey) --skip-duplicate }
displayName: 'NuGet Push'
failOnStderr: true