1
1
name : DSC-Release-$(Build.BuildId)
2
2
trigger : none
3
3
4
+ parameters :
5
+ - name : ' debugConsole'
6
+ displayName : ' Enable debug console'
7
+ type : boolean
8
+ default : false
9
+
4
10
pr :
5
11
branches :
6
12
include :
@@ -23,6 +29,8 @@ resources:
23
29
extends :
24
30
template : v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
25
31
parameters :
32
+ featureFlags :
33
+ debugConsole : ${{ parameters.debugConsole }}
26
34
customTags : ' ES365AIMigrationTooling'
27
35
globalSdl :
28
36
disableLegacyManifest : true
@@ -58,7 +66,6 @@ extends:
58
66
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
59
67
steps :
60
68
- checkout : self
61
- target : host
62
69
- pwsh : |
63
70
$packageVersion = $(repoRoot)/build.ps1 -GetPackageVersion
64
71
$vstsCommandString = "vso[task.setvariable variable=Version;isoutput=true]$packageVersion"
@@ -71,77 +78,96 @@ extends:
71
78
strategy :
72
79
matrix :
73
80
Windows x64 :
81
+ Suffix : x64
74
82
buildName : x86_64-pc-windows-msvc
75
83
Windows x64_arm64 :
84
+ Suffix : arm64
76
85
buildName : aarch64-pc-windows-msvc
77
86
variables :
78
87
PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
79
- ob_sdl_tsa_configFile : $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json
88
+ ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
80
89
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
81
- repoRoot : $(Build.SourcesDirectory)\DSC
82
- signSrcPath : $(repoRoot)/out
83
- ob_artifactBaseName : ' DSC-$(buildName) '
90
+ ob_artifactSuffix : $(Suffix)
91
+ repoRoot : ' $(Build.SourcesDirectory)\DSC '
92
+ signSrcPath : ' $(Build.SourcesDirectory)\out '
84
93
ob_sdl_sbom_enabled : true
85
94
ob_signing_setup_enabled : true
86
95
ob_sdl_codeql_compiled_enabled : false
87
96
pool :
88
97
type : windows
89
- displayName : Build
98
+ displayName : BuildWin
90
99
steps :
91
100
- checkout : self
92
- target : host
101
+ env :
102
+ ob_restore_phase : true
93
103
- task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
94
104
inputs :
95
105
Enabled : true
96
106
AnalyzeInPipeline : true
97
107
Language : rust
108
+ env :
109
+ ob_restore_phase : true
98
110
- pwsh : |
99
- $tmpdir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid())
100
- New-Item -ItemType Directory -Path $tmpdir
111
+ $tmpdir = "$(Agent.TempDirectory)"
101
112
Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
102
113
displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
114
+ env:
115
+ ob_restore_phase: true
103
116
- pwsh : |
104
117
Set-Location "$(Build.SourcesDirectory)/DSC"
105
118
./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
106
119
displayName: 'Build $(buildName)'
120
+ env:
121
+ ob_restore_phase: true
107
122
condition: succeeded()
108
123
- task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
109
124
condition : always()
125
+ env :
126
+ ob_restore_phase : true
110
127
- pwsh : |
111
128
$null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
112
129
$null = New-Item -ItemType Directory -Path "$(PackageRoot)/out" -ErrorAction Ignore
113
- $outPath = New-Item -ItemType Directory -Path "$(PackageRoot)/out/$(buildName )" -ErrorAction Ignore
130
+ $null = New-Item -ItemType Directory -Path "$(signSrcPath )" -ErrorAction Ignore
114
131
# workaround known issue of building in OneBranch copying from TMP folder
115
132
$null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
116
133
# copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign
117
- Copy-Item "$env:CARGO_TARGET_DIR/*.exe" "$(signSrcPath)"
118
- # Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Destination $outPath -Verbose -Force
119
- displayName: Copy binaries
134
+ write-host 'Binaries in $(env:CARGO_TARGET_DIR)'
135
+ Copy-Item -Path "$env:CARGO_TARGET_DIR/$(buildName)/$(BuildConfiguration)/*.exe" -Destination "$(signSrcPath)" -Verbose
136
+ Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Recurse -Destination "$(signSrcPath)" -Verbose -Force
137
+ write-host 'Binaries in $(signSrcPath)'
138
+ dir -r "$(signSrcPath)"
139
+ displayName: Copy built binaries
140
+ env:
141
+ ob_restore_phase: true
120
142
condition: succeeded()
121
143
- task : onebranch.pipeline.signing@1
122
144
displayName : Sign 1st party files
123
145
inputs :
124
146
command : ' sign'
125
147
signing_profile : external_distribution
126
148
files_to_sign : |
127
- *.exe;
128
- *.json;
129
- *.ps1;
149
+ **\*.exe;
150
+ **\*.ps1;
151
+ **\*.psd1;
152
+ **\*.psm1;
130
153
search_root : $(signSrcPath)
131
154
- task : CopyFiles@2
132
- displayName : " Copy signed files to ob_outputDirectory - '$(ob_outputDirectory)' "
155
+ displayName : " Copy signed files to build target dir "
133
156
inputs :
134
157
SourceFolder : " $(signSrcPath)"
135
- Contents : ' *'
136
- TargetFolder : $(ob_outputDirectory)
158
+ Contents : ' **'
159
+ TargetFolder : $(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)
160
+ OverWrite : true
137
161
- pwsh : |
138
- compress-archive -Path "$(ob_outputDirectory)/*" -DestinationPath "$(ob_outputDirectory)/DSC-$(PackageVersion)-$(buildName).zip"
139
- displayName: 'Compress $(buildName)'
162
+ Set-Location "$(Build.SourcesDirectory)/DSC"
163
+ ./build.ps1 -PackageType zip -Architecture $(buildName) -Release
164
+ Copy-Item ./bin/*.zip "$(ob_outputDirectory)"
165
+ displayName: 'Zip $(buildName)'
140
166
condition: succeeded()
141
167
- pwsh : |
142
168
Set-Location "$(Build.SourcesDirectory)/DSC"
143
- ./build.ps1 -msix -skipbuild
144
- Copy-Item *.msix "$(ob_outputDirectory)"
169
+ ./build.ps1 -PackageType msix -Architecture $(buildName) -Release -UseX64MakeAppx
170
+ Copy-Item ./bin/msix/ *.msix "$(ob_outputDirectory)" -Verbose
145
171
displayName: 'Create msix for $(buildName)'
146
172
condition: succeeded()
147
173
@@ -152,9 +178,20 @@ extends:
152
178
pool :
153
179
type : windows
154
180
steps :
181
+ - download : current
182
+ artifact : drop_BuildAndSign_BuildWinx64
183
+ patterns : ' *.msix'
184
+ - download : current
185
+ artifact : drop_BuildAndSign_BuildWinarm64
186
+ patterns : ' *.msix'
187
+ - checkout : self
155
188
- pwsh : |
156
189
Set-Location "$(Build.SourcesDirectory)/DSC"
157
- ./build.ps1 -msixbundle
190
+ $null = New-Item -ItemType Directory -Path "./bin/msix" -Force -ErrorAction Ignore
191
+ Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWinx64/*.msix" ./bin/msix -Verbose
192
+ Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWinarm64/*.msix" ./bin/msix -Verbose
193
+ ./build.ps1 -PackageType msixbundle
194
+ Copy-Item ./bin/*.msixbundle "$(ob_outputDirectory)"
158
195
displayName: 'Create msixbundle'
159
196
condition: succeeded()
160
197
@@ -185,12 +222,10 @@ extends:
185
222
steps :
186
223
- pwsh : |
187
224
./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu
225
+ ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release
226
+ Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
188
227
displayName: 'Build x86_64-unknown-linux-gnu'
189
228
condition: succeeded()
190
- - pwsh : |
191
- tar czf '$(ob_outputDirectory)/DSC-$(PackageVersion)-x86_64-unknown-linux-gnu.tar.gz' -C $(Build.SourcesDirectory)/bin/x86_64-unknown-linux-gnu/$(BuildConfiguration) .
192
- displayName: 'Compress x86_64-unknown-linux-gnu'
193
- condition: succeeded()
194
229
195
230
- job : BuildLinuxArm64
196
231
dependsOn : SetPackageVersion
@@ -204,19 +239,17 @@ extends:
204
239
steps :
205
240
- pwsh : |
206
241
./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
242
+ ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
243
+ Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
207
244
displayName: 'Build aarch64-unknown-linux-gnu'
208
245
condition: succeeded()
209
- - pwsh : |
210
- tar czf '$(ob_outputDirectory)/DSC-$(PackageVersion)-aarch64-unknown-linux-gnu.tar.gz' -C $(Build.SourcesDirectory)/bin/aarch64-unknown-linux-gnu/$(BuildConfiguration) .
211
- displayName: 'Compress aarch64-unknown-linux-gnu'
212
- condition: succeeded()
213
246
214
247
- job : BuildMac
215
248
dependsOn : SetPackageVersion
216
249
variables :
217
250
PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
218
251
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
219
- displayName : Build
252
+ displayName : BuildMac
220
253
pool :
221
254
type : linux
222
255
isCustom : true
@@ -231,12 +264,11 @@ extends:
231
264
steps :
232
265
- pwsh : |
233
266
./build.ps1 -Release -Architecture $(buildName)
267
+ ./build.ps1 -PackageType tgz -Architecture $(buildName) -Release
268
+ Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
269
+ Write-Host "##vso[artifact.upload containerfolder=release;artifactname=release]$(ob_outputDirectory)/DSC-$(PackageVersion)-$(buildName).tar.gz"
234
270
displayName: 'Build $(buildName)'
235
271
condition: succeeded()
236
- - pwsh : |
237
- tar czf '$(ob_outputDirectory)/DSC-$(PackageVersion)-$(buildName).tar.gz' -C $(Build.SourcesDirectory)/bin/$(buildName)/$(BuildConfiguration) .
238
- displayName: 'Compress $(buildName)'
239
- condition: succeeded()
240
272
241
273
- stage : Release
242
274
dependsOn : BuildAndSign
0 commit comments