-
Notifications
You must be signed in to change notification settings - Fork 586
/
azure-pipelines.yml
222 lines (194 loc) · 6.68 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
220
221
222
trigger:
batch: true
branches:
include:
- main
- release/3.0
pr:
branches:
include:
- main
- release/3.0
variables:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: OfficialBuildId
value: $(Build.BuildNumber)
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 1
- name: DOTNET_MULTILEVEL_LOOKUP
value: 0
resources:
containers:
- container: LinuxContainer
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-20210714125435-9b5bbc2
stages:
- stage: Build
jobs:
- job: Windows_NT
displayName: Windows Build
pool:
vmImage: windows-latest
strategy:
matrix:
Build_Release:
BuildConfiguration: Release
Build_Debug:
BuildConfiguration: Debug
steps:
- powershell: |
npm install -g markdownlint-cli
markdownlint -c $(System.DefaultWorkingDirectory)/.markdownlint.json $(System.DefaultWorkingDirectory)
displayName: 'Execute Markdownlint'
condition: eq(variables['build.reason'], 'PullRequest')
# Hint: Add /maxCpuCount:1 to disable parellelization in build. Ensures all tests results are printed to the console
- script: build.cmd -ci
-configuration $(BuildConfiguration)
-prepareMachine
/p:BuildPackages=true
displayName: Build
- task: PublishBuildArtifacts@1
displayName: Publish Build logs
condition: always()
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/
artifactName: BuildLogs-Windows-$(BuildConfiguration)
artifactType: container
- task: CopyFiles@2
condition: eq(variables['BuildConfiguration'], 'Release')
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(BuildConfiguration)/Shipping
targetFolder: $(Build.ArtifactStagingDirectory)/Packages
- task: PublishTestResults@2
inputs:
mergeTestResults: true
- publish: $(Build.ArtifactStagingDirectory)/Packages
displayName: Publish Build Artifacts
artifact: BuildPackages
condition: eq(variables['BuildConfiguration'], 'Release')
- publish: config
displayName: Publish Signing Scripts
artifact: config
condition: eq(variables['BuildConfiguration'], 'Release')
- job: Markdown_link_check
displayName: Markdown Link Check
pool:
vmImage: windows-latest
# Use Version 3.10.3 of markdown-link-check, as 3.11.0 is broken (completely ignores the json file)
steps:
- powershell: |
npm install -g [email protected]
ls -r *.md | % { markdown-link-check -v -c $(System.DefaultWorkingDirectory)\.markdown-link-check.json $_.FullName; if (-Not $?) { throw "One of the links is wrong" } }
displayName: 'Execute markdown-link-check'
condition: eq(variables['build.reason'], 'PullRequest')
- job: Linux
displayName: Linux Build
container: LinuxContainer
pool:
vmImage: ubuntu-latest
strategy:
matrix:
Build_Release:
BuildConfiguration: Release
Build_Debug:
BuildConfiguration: Debug
steps:
- script: ./build.sh --ci
--configuration $(BuildConfiguration)
--prepareMachine
displayName: Build
- script: ./eng/common/msbuild.sh --warnaserror false --ci
eng/sendToHelix.proj
/t:Test
/p:TestOS=Unix
/p:Configuration=$(_BuildConfig)
/p:HelixBuild=$(Build.BuildNumber)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
# /p:HelixAccessToken=$(HelixApiAccessToken)
displayName: Run Helix Tests
condition: eq(variables['build.reason'], 'PullRequest')
# env:
# SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: PublishBuildArtifacts@1
displayName: Publish Build logs
condition: always()
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/
artifactName: BuildLogs-Linux-$(BuildConfiguration)
artifactType: container
- job: MacOS
displayName: MacOS Build
pool:
vmImage: macOS-latest
strategy:
matrix:
Build_Release:
BuildConfiguration: Release
Build_Debug:
BuildConfiguration: Debug
steps:
- script: ./build.sh --ci
--configuration $(BuildConfiguration)
--prepareMachine /maxCpuCount:1
displayName: Build
- task: PublishBuildArtifacts@1
displayName: Publish Build logs
condition: always()
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/
artifactName: BuildLogs-MacOS-$(BuildConfiguration)
artifactType: container
- stage: CodeSign
condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest')))
jobs:
- deployment: CodeSign
displayName: Code Signing
pool:
vmImage: windows-latest
environment: Dotnet Iot
variables:
- group: SignClient
strategy:
runOnce:
deploy:
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
--input "**/*.nupkg" `
--config "$(Pipeline.Workspace)\config\SignClient.json" `
--filelist "$(Pipeline.Workspace)\config\filelist.txt" `
--user "$(SignClientUser)" `
--secret '$(SignClientSecret)' `
--name "DotnetIoT" `
--description "dotnet/iot" `
--descriptionUrl "https://github.com/dotnet/iot"
displayName: Sign packages
- publish: $(Pipeline.Workspace)/BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages
- stage: Publish
condition: and(succeeded('Build'), succeeded('CodeSign'), not(eq(variables['build.reason'], 'PullRequest')))
jobs:
- deployment: Publish
displayName: Publish signed packages
pool:
vmImage: windows-latest
environment: Dotnet Iot
strategy:
runOnce:
deploy:
steps:
- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate'
- task: NuGetCommand@2
displayName: 'Publish to feed'
inputs:
command: push
publishVstsFeed: 'IoT/nightly_iot_builds'
packagesToPush: '$(Pipeline.Workspace)/SignedPackages/*.nupkg'