forked from Azure-Samples/Cognitive-Services-Voice-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
252 lines (217 loc) · 8.08 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
# "Customize your pipeline" on MS docs:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/customize-pipeline
# Specific branch build with batching
trigger:
batch: true
branches:
include:
- main
pr:
branches:
include:
- main
variables:
# Common Build configurations
buildPlatformNative: x64
buildPlatformManaged: 'Any CPU'
buildConfiguration: Release
dotNetCoreRuntimeIdentifier: win-x64
dotNetCoreVersion: '3.1'
# Sample 1: Windows Voice Assistant Client, C# WPF (\clients\csharp-wpf)
sample1Name: VoiceAssistantClient
sample1Folder: 'clients\csharp-wpf'
sample1Solution: '$(sample1Folder)\$(sample1Name).sln'
sample1PublishedArtifactPath: '$(sample1Folder)\$(sample1Name)\bin\$(buildPlatformNative)\$(buildConfiguration)'
sample1PublishedArtifactName: 'WindowsVoiceAssistantClient-$(Build.BuildNumber)'
# Sample 2: Voice Assistant Test, .NET core (\clients\csharp-dotnet-core\voice-assistant-test)
sample2Name: VoiceAssistantTest
sample2Folder: 'clients\csharp-dotnet-core\voice-assistant-test\tool'
sample2Solution: '$(sample2Folder)\$(sample2Name).sln'
sample2PublishedArtifactPath: '$(sample2Name)Publish'
sample2PublishedArtifactName: 'VoiceAssistantTest-$(Build.BuildNumber)'
# Sample 3: Windows console Voice Assistant Client, C++ (\clients\cpp-console)
sample3Name: VoiceAssistantCPPClient
sample3Folder: 'clients\cpp-console'
sample3Solution: '$(sample3Folder)\src\windows\cppSample.sln'
sample3PublishedArtifactPath: '$(sample3Folder)\src\windows\$(buildPlatformNative)\$(buildConfiguration)'
sample3PublishedArtifactName: '$(sample3Name)-$(Build.BuildNumber)'
# Sample 4: UWP Voice Assistant Sample (\clients\csharp-uwp)
sample4Name: UWPVoiceAssistantSample
sample4Folder: 'clients\csharp-uwp'
sample4Solution: '$(sample4Folder)\$(sample4Name).sln'
sample4PublishedArtifactPath: '$(sample4Folder)\$(sample4Name)\bin\$(buildPlatformNative)\$(buildConfiguration)'
sample4PublishedArtifactName: '$(sample4Name)-$(Build.BuildNumber)'
# ESRP code signing
signParams: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
jobs:
- job: Windows_Builds
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetToolInstaller@1
# Build Windows Voice Assistant Client (C#, WPF)
- task: NuGetCommand@2
displayName: '$(sample1Name) - NuGetCommand'
inputs:
restoreSolution: '$(sample1Solution)'
- task: VSBuild@1
displayName: '$(sample1Name) - VSBuild'
inputs:
solution: '$(sample1Solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatformNative)'
configuration: '$(buildConfiguration)'
#
# Disable signing until we find time to set up a Key Vault. The correct certificate is about to expire.
# "All certificates used for integrating with ESRP are now required to be held in an Azure Key Vault (AKV)"
# https://microsoft.sharepoint.com/teams/prss/esrp/info/ESRP%20Onboarding%20Wiki/Generating%20the%20ESRP%20Authentication%20(Request%20Signing)%20certificate.aspx
#
#- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
# displayName: '$(sample1Name) - EsrpCodeSigning'
# inputs:
# ConnectedServiceName: 'Voice Assistant Sample Code ESRP Signing'
# signConfigType: inlineSignParams
# inlineOperation: '$(signParams)'
# FolderPath: '$(sample1PublishedArtifactPath)'
# Pattern: 'VoiceAssistantClient.exe'
# SessionTimeout: '60'
- task: PublishPipelineArtifact@1
displayName: '$(sample1Name) - PublishPipelineArtifact'
inputs:
path: $(sample1PublishedArtifactPath)
artifact: $(sample1PublishedArtifactName)
# Build Voice Assistant Test (C# .NET Core)
- task: DotNetCoreCLI@2
displayName: '$(sample2Name) - DotNetCoreCLI'
inputs:
Command: 'publish'
Projects: $(sample2Solution)
publishWebProjects: false
Arguments: '-r $(dotNetCoreRuntimeIdentifier) -c $(buildConfiguration) -o $(sample2PublishedArtifactPath) /p:PublishSingleFile=true'
zipAfterPublish: false
modifyOutputPath: true
- task: PublishPipelineArtifact@1
displayName: '$(sample2Name) - PublishPipelineArtifact'
inputs:
path: $(sample2PublishedArtifactPath)
artifact: $(sample2PublishedArtifactName)
# Build C++ console application
- task: NuGetCommand@2
displayName: '$(sample3Name) - NuGetCommand'
inputs:
restoreSolution: '$(sample3Solution)'
- task: VSBuild@1
displayName: '$(sample3Name) - VSBuild'
inputs:
solution: '$(sample3Solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatformNative)'
configuration: '$(buildConfiguration)'
- task: DeleteFiles@1
inputs:
sourceFolder: $(sample3PublishedArtifactPath)
contents: |
*.txt
*.sarif
*.obj
*.xml
*.ilk
*.tlog
*.iobj
*.ipdb
- task: PublishPipelineArtifact@1
displayName: '$(sample3Name) - PublishPipelineArtifact'
inputs:
path: $(sample3PublishedArtifactPath)
artifact: $(sample3PublishedArtifactName)
# Build UWP Voice Assistant Sample (C# UWP)
- task: NuGetCommand@2
displayName: '$(sample4Name) - NuGetCommand'
inputs:
restoreSolution: '$(sample4Solution)'
- task: VSBuild@1
displayName: '$(sample4Name) - VSBuild'
inputs:
solution: '$(sample4Solution)'
msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatformNative)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload'
platform: '$(buildPlatformNative)'
configuration: '$(buildConfiguration)'
- task: PublishPipelineArtifact@1
displayName: '$(sample4Name) - PublishPipelineArtifact'
inputs:
path: $(sample4PublishedArtifactPath)
artifact: $(sample4PublishedArtifactName)
#- task: VSTest@2
# inputs:
# platform: '$(buildPlatformNative)'
# configuration: '$(buildConfiguration)'
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- task: PoliCheck@1
inputs:
inputType: 'Basic'
targetType: 'F'
targetArgument: '$(Build.SourcesDirectory)'
result: 'PoliCheck.xml'
# This does not work on self-hosted agent for some reason
- task: notice@0
inputs:
outputformat: 'text'
- job: Linux_Builds
pool:
name: Azure Pipelines
vmImage: 'ubuntu-latest'
steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: sudo apt-get install libasound2-dev
- task: Bash@3
inputs:
targetType: 'inline'
script: ./buildx64Linux.sh
workingDirectory: ./clients/cpp-console/scripts/linux/