forked from dotnet/iot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
216 lines (190 loc) · 6.41 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
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:ubuntu-14.04-cross-0cd4667-20170319080304
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')
- script: build.cmd -ci
-configuration $(BuildConfiguration)
-prepareMachine
/p:BuildPackages=true
displayName: Build
- script: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci
eng/sendToHelix.proj
/t:Test
/p:TestOS=Windows_NT
/p:Configuration=$(BuildConfiguration)
/p:HelixBuild=$(Build.BuildNumber)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/SendToHelix.binlog
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-Windows-$(BuildConfiguration)
artifactType: container
- task: CopyFiles@2
condition: eq(variables['BuildConfiguration'], 'Release')
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(BuildConfiguration)/Shipping
targetFolder: $(Build.ArtifactStagingDirectory)/Packages
- 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: 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
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@0
displayName: 'NuGet Authenticate'
- task: NuGetCommand@2
displayName: 'Publish to feed'
inputs:
command: push
publishVstsFeed: 'IoT/nightly_iot_builds'
packagesToPush: '$(Pipeline.Workspace)/SignedPackages/*.nupkg'