-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines.yml
220 lines (208 loc) · 7.52 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
trigger:
batch: true
tags:
include:
- '*'
branches:
include:
- main
pr:
branches:
include:
- '*'
paths:
include:
- '*'
stages:
- stage: Build
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
dependsOn: []
jobs:
#//////////////////////////////////////////////////////////////////////
#// Linux
#//////////////////////////////////////////////////////////////////////
- job: Linux
pool:
vmImage: ubuntu-latest
timeoutInMinutes: 10
variables:
- name: version
value: $[ replace(variables['Build.SourceBranch'], 'refs/tags/', '') ]
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: npm install -g vsce webpack webpack-cli
displayName: 'Install Node tools'
- script: dotnet cake --target=vsix --release-version=$(version) --configuration=release --arch=linux-x64
displayName: 'Build VSIX (linux-x64)'
- script: dotnet cake --target=vsix --release-version=$(version) --configuration=release --arch=linux-arm64
displayName: 'Build VSIX (linux-arm64)'
- publish: '$(System.DefaultWorkingDirectory)/artifacts'
displayName: 'Publish Artifacts'
artifact: 'Linux Build'
#//////////////////////////////////////////////////////////////////////
#// MacOS
#//////////////////////////////////////////////////////////////////////
- job: MacOS
pool:
vmImage: macos-latest
timeoutInMinutes: 10
variables:
- name: version
value: $[ replace(variables['Build.SourceBranch'], 'refs/tags/', '') ]
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: npm install -g vsce webpack webpack-cli
displayName: 'Install Node tools'
- script: dotnet cake --target=vsix --release-version=$(version) --configuration=release --arch=osx-x64
displayName: 'Build VSIX (osx-x64)'
- script: dotnet cake --target=vsix --release-version=$(version) --configuration=release --arch=osx-arm64
displayName: 'Build VSIX (osx-arm64)'
- publish: '$(System.DefaultWorkingDirectory)/artifacts'
displayName: 'Publish Artifacts'
artifact: 'MacOS Build'
#//////////////////////////////////////////////////////////////////////
#// Windows
#//////////////////////////////////////////////////////////////////////
- job: Windows
pool:
vmImage: windows-latest
timeoutInMinutes: 15
variables:
- name: version
value: $[ replace(variables['Build.SourceBranch'], 'refs/tags/', '') ]
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: npm install -g vsce webpack webpack-cli
displayName: 'Install Node tools'
- script: dotnet cake --target=vsix --release-version=$(version) --configuration=release --arch=win-x64
displayName: 'Build VSIX (win-x64)'
- script: dotnet cake --target=vsix --release-version=$(version) --configuration=release --arch=win-arm64
displayName: 'Build VSIX (win-arm64)'
- publish: '$(System.DefaultWorkingDirectory)/artifacts'
displayName: 'Publish Artifacts'
artifact: 'Windows Build'
#//////////////////////////////////////////////////////////////////////
#// Publish
#//////////////////////////////////////////////////////////////////////
- job: Publish
dependsOn: [Linux, MacOS, Windows]
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
pool:
vmImage: ubuntu-latest
variables:
- group: secrets
timeoutInMinutes: 4
steps:
- download: current
artifact: 'Linux Build'
- download: current
artifact: 'MacOS Build'
- download: current
artifact: 'Windows Build'
- task: GitHubRelease@1
inputs:
gitHubConnection: 'upstream'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
tagSource: 'gitTag'
assets: '$(Pipeline.Workspace)/**/*.vsix'
- script: npm install -g vsce
displayName: 'Install VSCode builder'
- task: Bash@3
displayName: 'Publish VSIX'
env:
VS_TOKEN: $(VSMP_TOKEN)
inputs:
targetType: 'inline'
script: |
for filename in $(Pipeline.Workspace)/**/*.vsix; do
vsce publish --packagePath "$filename" -p $VS_TOKEN
done
- stage: Tests
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags'))
dependsOn: []
jobs:
#//////////////////////////////////////////////////////////////////////
#// MacOS Tests
#//////////////////////////////////////////////////////////////////////
- job: MacOS
pool:
vmImage: macos-latest
timeoutInMinutes: 10
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: dotnet cake --target=test --configuration=release
displayName: 'Run tests'
continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'artifacts/*.trx'
failTaskOnFailedTests: true
failTaskOnMissingResultsFile: true
#//////////////////////////////////////////////////////////////////////
#// Linux Tests
#//////////////////////////////////////////////////////////////////////
- job: Linux
pool:
vmImage: ubuntu-latest
timeoutInMinutes: 10
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: dotnet cake --target=test --configuration=release
displayName: 'Run tests'
continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'artifacts/*.trx'
failTaskOnFailedTests: true
failTaskOnMissingResultsFile: true
#//////////////////////////////////////////////////////////////////////
#// Windows Tests
#//////////////////////////////////////////////////////////////////////
- job: Windows
pool:
vmImage: windows-latest
timeoutInMinutes: 10
steps:
- task: UseDotNet@2
inputs:
version: '9.x'
includePreviewVersions: true
- script: dotnet tool restore
displayName: 'Restore .NET tools'
- script: dotnet cake --target=test --configuration=release
displayName: 'Run tests'
continueOnError: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: 'artifacts/*.trx'
failTaskOnFailedTests: true
failTaskOnMissingResultsFile: true