-
Notifications
You must be signed in to change notification settings - Fork 29
/
azure-pipelines.yml
102 lines (87 loc) · 2.91 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
94
95
96
97
98
99
100
101
102
name: 2.3.$(revision).0
trigger:
- master
variables:
solution: 'src\Build.proj'
buildConfiguration: 'Release'
revision: $[counter('', 0)]
WaitForRemoteConnectionOnFailure: false
jobs:
- job: Build
timeoutInMinutes: 360
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
displayName: 'Get sources'
persistCredentials: true
- task: PowerShell@2
displayName: 'Enable remote connection'
inputs:
filePath: 'build\TeamViewer\EnableRemoteConnection.ps1'
- task: Cache@2
inputs:
key: deps | deps.lock
path: $(Pipeline.Workspace)/.deps
- task: PowerShell@2
displayName: 'Download and install dependencies'
inputs:
filePath: 'build\DownloadAndInstallDependencies.ps1'
- task: PowerShell@2
displayName: 'Apply version to assemblies'
inputs:
filePath: 'build\ApplyVersionToAssemblies.ps1'
- task: VSBuild@1
inputs:
solution: '$(solution)'
configuration: '$(buildConfiguration)'
msbuildArgs: '/target:Build;Pack'
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: '**\bin\$(buildConfiguration)\**\*Test.dll'
vsTestVersion: '14.0'
uiTests: true
rerunFailedTests: true
runSettingsFile: '$(Build.SourcesDirectory)\src\Local.testsettings'
- task: CopyFiles@2
inputs:
contents: '*.nupkg'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PowerShell@2
displayName: 'Copy Chocolatey Logs'
condition: failed()
inputs:
filePath: 'build\Chocolatey\CopyChocolateyLogs.ps1'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: drop
- task: PowerShell@2
displayName: 'Publish NuGet Packages'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
targetType: 'inline'
script: 'nuget push $(Build.ArtifactStagingDirectory)\*.nupkg -ApiKey $(myNuGetApiKey) -Source https://api.nuget.org/v3/index.json'
- task: PowerShell@2
displayName: 'Git Tag'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
env:
tag: '$(Build.BuildNumber)'
inputs:
targetType: 'inline'
workingDirectory: $(Build.SourcesDirectory)
ignoreLASTEXITCODE: false
errorActionPreference: continue
failOnStderr: false
script: |
Write-Host "git tag $env:tag"
git tag $env:tag
Write-Host "git push origin $env:tag"
git push origin $env:tag
- task: PowerShell@2
displayName: 'Wait for remote connection'
condition: and(failed(), eq(variables['WaitForRemoteConnectionOnFailure'], 'true'))
inputs:
filePath: 'build\TeamViewer\WaitForRemoteConnection.ps1'