11name : DSC-Release-$(Build.BuildId)
22trigger : none
33
4+ parameters :
5+ - name : ' debugConsole'
6+ displayName : ' Enable debug console'
7+ type : boolean
8+ default : false
9+
410pr :
511 branches :
612 include :
@@ -23,6 +29,8 @@ resources:
2329extends :
2430 template : v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates
2531 parameters :
32+ featureFlags :
33+ debugConsole : ${{ parameters.debugConsole }}
2634 customTags : ' ES365AIMigrationTooling'
2735 globalSdl :
2836 disableLegacyManifest : true
@@ -58,7 +66,6 @@ extends:
5866 ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
5967 steps :
6068 - checkout : self
61- target : host
6269 - pwsh : |
6370 $packageVersion = $(repoRoot)/build.ps1 -GetPackageVersion
6471 $vstsCommandString = "vso[task.setvariable variable=Version;isoutput=true]$packageVersion"
@@ -71,77 +78,96 @@ extends:
7178 strategy :
7279 matrix :
7380 Windows x64 :
81+ Suffix : x64
7482 buildName : x86_64-pc-windows-msvc
7583 Windows x64_arm64 :
84+ Suffix : arm64
7685 buildName : aarch64-pc-windows-msvc
7786 variables :
7887 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'
8089 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 '
8493 ob_sdl_sbom_enabled : true
8594 ob_signing_setup_enabled : true
8695 ob_sdl_codeql_compiled_enabled : false
8796 pool :
8897 type : windows
89- displayName : Build
98+ displayName : BuildWin
9099 steps :
91100 - checkout : self
92- target : host
101+ env :
102+ ob_restore_phase : true
93103 - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
94104 inputs :
95105 Enabled : true
96106 AnalyzeInPipeline : true
97107 Language : rust
108+ env :
109+ ob_restore_phase : true
98110 - pwsh : |
99- $tmpdir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid())
100- New-Item -ItemType Directory -Path $tmpdir
111+ $tmpdir = "$(Agent.TempDirectory)"
101112 Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
102113 displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
114+ env:
115+ ob_restore_phase: true
103116 - pwsh : |
104117 Set-Location "$(Build.SourcesDirectory)/DSC"
105118 ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
106119 displayName: 'Build $(buildName)'
120+ env:
121+ ob_restore_phase: true
107122 condition: succeeded()
108123 - task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
109124 condition : always()
125+ env :
126+ ob_restore_phase : true
110127 - pwsh : |
111128 $null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
112129 $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
114131 # workaround known issue of building in OneBranch copying from TMP folder
115132 $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
116133 # 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
120142 condition: succeeded()
121143 - task : onebranch.pipeline.signing@1
122144 displayName : Sign 1st party files
123145 inputs :
124146 command : ' sign'
125147 signing_profile : external_distribution
126148 files_to_sign : |
127- *.exe;
128- *.json;
129- *.ps1;
149+ **\*.exe;
150+ **\*.ps1;
151+ **\*.psd1;
152+ **\*.psm1;
130153 search_root : $(signSrcPath)
131154 - task : CopyFiles@2
132- displayName : " Copy signed files to ob_outputDirectory - '$(ob_outputDirectory)' "
155+ displayName : " Copy signed files to build target dir "
133156 inputs :
134157 SourceFolder : " $(signSrcPath)"
135- Contents : ' *'
136- TargetFolder : $(ob_outputDirectory)
158+ Contents : ' **'
159+ TargetFolder : $(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)
160+ OverWrite : true
137161 - 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)'
140166 condition: succeeded()
141167 - pwsh : |
142168 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
145171 displayName: 'Create msix for $(buildName)'
146172 condition: succeeded()
147173
@@ -152,9 +178,20 @@ extends:
152178 pool :
153179 type : windows
154180 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
155188 - pwsh : |
156189 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)"
158195 displayName: 'Create msixbundle'
159196 condition: succeeded()
160197
@@ -185,12 +222,10 @@ extends:
185222 steps :
186223 - pwsh : |
187224 ./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)"
188227 displayName: 'Build x86_64-unknown-linux-gnu'
189228 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()
194229
195230 - job : BuildLinuxArm64
196231 dependsOn : SetPackageVersion
@@ -204,19 +239,17 @@ extends:
204239 steps :
205240 - pwsh : |
206241 ./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)"
207244 displayName: 'Build aarch64-unknown-linux-gnu'
208245 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()
213246
214247 - job : BuildMac
215248 dependsOn : SetPackageVersion
216249 variables :
217250 PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
218251 ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
219- displayName : Build
252+ displayName : BuildMac
220253 pool :
221254 type : linux
222255 isCustom : true
@@ -231,12 +264,11 @@ extends:
231264 steps :
232265 - pwsh : |
233266 ./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"
234270 displayName: 'Build $(buildName)'
235271 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()
240272
241273 - stage : Release
242274 dependsOn : BuildAndSign
0 commit comments