-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
149 lines (127 loc) · 4.44 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
branches:
include:
- "*"
tags:
include:
- "*.*.*"
- "*.*.*-rc*"
pool:
vmImage: 'windows-2022'
variables:
solution: '*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
isPullRequest: $[eq(variables['Build.Reason'], 'PullRequest')]
jobs:
- job: VersionUpdateAndValidation
steps:
- checkout: self
submodules: true
- task: Bash@3
inputs:
targetType: 'inline'
script: |
git checkout main
git checkout -
- task: Bash@3
inputs:
filePath: '$(System.DefaultWorkingDirectory)/pre-build-phase-1.sh'
name: versioning
- job: VsixVersionUpdateAndBuild
dependsOn: VersionUpdateAndValidation
condition: succeeded('VersionUpdateAndValidation')
variables:
activeBranch: $[dependencies.VersionUpdateAndValidation.outputs['versioning.activeBranch']]
latestMajor: $[dependencies.VersionUpdateAndValidation.outputs['versioning.latestMajor']]
latestMinor: $[dependencies.VersionUpdateAndValidation.outputs['versioning.latestMinor']]
latestPatch: $[dependencies.VersionUpdateAndValidation.outputs['versioning.latestPatch']]
isMarketplaceRelease: $[dependencies.VersionUpdateAndValidation.outputs['versioning.isMarketplaceRelease']]
isReleaseCandidate: $[dependencies.VersionUpdateAndValidation.outputs['versioning.isReleaseCandidate']]
revisionCounter: $[counter(format('{0}.{1}.{2}-{3}', variables['latestMajor'], variables['latestMinor'], variables['latestPatch'], variables['isMarketplaceRelease']), 0)]
steps:
- checkout: self
submodules: true
- task: Bash@3
inputs:
filePath: '$(System.DefaultWorkingDirectory)/pre-build-phase-2.sh'
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\RoslyJump*xUnit.dll
**\dngrep*xunit.dll
!**\*TestAdapter.dll
!**\obj\**
!**\bin\**\ref\**
searchFolder: '$(System.DefaultWorkingDirectory)'
runInParallel: true
codeCoverageEnabled: true
otherConsoleOptions: '/Framework:.NETCoreApp,Version=3.1'
- task: CopyFiles@2
displayName: 'Copy pre-release.sh'
inputs:
contents: pre-release.sh
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
displayName: 'Publish Release Scripts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'release'
publishLocation: 'Container'
- task: DeleteFiles@1
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)'
Contents: 'pre-release.sh'
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'
inputs:
contents: |
PublishManifests\publishManifest2019.json
PublishManifests\publishManifest2022.json
build-results.json
readme.md
**\*.vsix
targetFolder: $(Build.ArtifactStagingDirectory)
- task: CopyFiles@2
displayName: 'Copy readme to publishManifests'
inputs:
contents: |
readme.md
targetFolder: $(Build.ArtifactStagingDirectory)\PublishManifests
- task: PublishBuildArtifacts@1
displayName: 'Publish Prod Artifact'
condition: eq(variables['isMarketplaceRelease'], 'true')
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'prod'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: 'Publish RC Artifact'
condition: eq(variables['isReleaseCandidate'], 'true')
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'rc'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: 'Publish Dev Artifact'
condition: and(ne(variables['isReleaseCandidate'], 'true'), ne(variables['isMarketplaceRelease'], 'true'))
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'ci'
publishLocation: 'Container'