@@ -85,29 +85,128 @@ extends:
85
85
Write-Host "##$vstsCommandString"
86
86
name: Package
87
87
88
- - job : BuildWin
88
+ - job : BuildWin_x64
89
+ dependsOn : SetPackageVersion
90
+ variables :
91
+ buildName : x86_64-pc-windows-msvc
92
+ PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
93
+ ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
94
+ ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
95
+ ob_artifactSuffix : x64
96
+ repoRoot : ' $(Build.SourcesDirectory)\DSC'
97
+ signSrcPath : ' $(Build.SourcesDirectory)\out'
98
+ ob_sdl_sbom_enabled : true
99
+ ob_signing_setup_enabled : true
100
+ ob_sdl_codeql_compiled_enabled : true
101
+ pool :
102
+ type : windows
103
+ displayName : BuildWin_x64
104
+ steps :
105
+ - checkout : self
106
+ env :
107
+ ob_restore_phase : true
108
+ - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
109
+ inputs :
110
+ Enabled : true
111
+ AnalyzeInPipeline : true
112
+ Language : rust
113
+ env :
114
+ ob_restore_phase : true
115
+ - pwsh : |
116
+ $tmpdir = "$(Agent.TempDirectory)"
117
+ Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
118
+ displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
119
+ env:
120
+ ob_restore_phase: true
121
+ - task : RustInstaller@1
122
+ inputs :
123
+ rustVersion : ms-stable
124
+ toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
125
+ additionalTargets : $(buildName)
126
+ displayName : Install Rust
127
+ env :
128
+ ob_restore_phase : true
129
+ - pwsh : |
130
+ Set-Location "$(Build.SourcesDirectory)/DSC"
131
+ $LLVMBIN = "$($env:PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\bin"
132
+ if (!(Test-Path $LLVMBIN)) {
133
+ throw "LLVM path '$LLVMBIN' does not exist"
134
+ }
135
+ $env:PATH += ";$LLVMBIN"
136
+ write-verbose -verbose (gcm clang.exe | out-string)
137
+ ./build.ps1 -Verbose -Release -Architecture $(buildName) -SkipLinkCheck
138
+ displayName: 'Build $(buildName)'
139
+ env:
140
+ ob_restore_phase: true
141
+ condition: succeeded()
142
+ - task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
143
+ condition : always()
144
+ env :
145
+ ob_restore_phase : true
146
+ - pwsh : |
147
+ $null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
148
+ $null = New-Item -ItemType Directory -Path "$(PackageRoot)/out" -ErrorAction Ignore
149
+ $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
150
+ # workaround known issue of building in OneBranch copying from TMP folder
151
+ $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
152
+ # copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign
153
+ write-host 'Binaries in $(env:CARGO_TARGET_DIR)'
154
+ Copy-Item -Path "$env:CARGO_TARGET_DIR/$(buildName)/$(BuildConfiguration)/*.exe" -Destination "$(signSrcPath)" -Verbose
155
+ Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Recurse -Destination "$(signSrcPath)" -Verbose -Force
156
+ write-host 'Binaries in $(signSrcPath)'
157
+ dir -r "$(signSrcPath)"
158
+ displayName: Copy built binaries
159
+ env:
160
+ ob_restore_phase: true
161
+ condition: succeeded()
162
+ - task : onebranch.pipeline.signing@1
163
+ displayName : Sign 1st party files
164
+ inputs :
165
+ command : ' sign'
166
+ signing_profile : external_distribution
167
+ files_to_sign : |
168
+ **\*.exe;
169
+ **\*.ps1;
170
+ **\*.psd1;
171
+ **\*.psm1;
172
+ search_root : $(signSrcPath)
173
+ - task : CopyFiles@2
174
+ displayName : " Copy signed files to build target dir"
175
+ inputs :
176
+ SourceFolder : " $(signSrcPath)"
177
+ Contents : ' **'
178
+ TargetFolder : $(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)
179
+ OverWrite : true
180
+ - pwsh : |
181
+ Set-Location "$(Build.SourcesDirectory)/DSC"
182
+ ./build.ps1 -PackageType zip -Architecture $(buildName) -Release
183
+ Copy-Item ./bin/*.zip "$(ob_outputDirectory)"
184
+ displayName: 'Zip $(buildName)'
185
+ condition: succeeded()
186
+ - pwsh : |
187
+ Set-Location "$(Build.SourcesDirectory)/DSC"
188
+ ./build.ps1 -PackageType msix -Architecture $(buildName) -Release -UseX64MakeAppx
189
+ Copy-Item ./bin/msix/*.msix "$(ob_outputDirectory)" -Verbose
190
+ displayName: 'Create msix for $(buildName)'
191
+ condition: succeeded()
192
+
193
+ - job : BuildWin_arm64
89
194
dependsOn : SetPackageVersion
90
- strategy :
91
- matrix :
92
- Windows x64 :
93
- Suffix : x64
94
- buildName : x86_64-pc-windows-msvc
95
- Windows x64_arm64 :
96
- Suffix : arm64
97
- buildName : aarch64-pc-windows-msvc
98
195
variables :
196
+ buildName : aarch64-pc-windows-msvc
99
197
PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
100
198
ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
101
199
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
102
- ob_artifactSuffix : $(Suffix)
200
+ ob_artifactSuffix : arm64
103
201
repoRoot : ' $(Build.SourcesDirectory)\DSC'
104
202
signSrcPath : ' $(Build.SourcesDirectory)\out'
105
203
ob_sdl_sbom_enabled : true
106
204
ob_signing_setup_enabled : true
107
205
ob_sdl_codeql_compiled_enabled : true
108
206
pool :
109
207
type : windows
110
- displayName : BuildWin
208
+ hostArchitecture : arm64
209
+ displayName : BuildWin_arm64
111
210
steps :
112
211
- checkout : self
113
212
env :
@@ -198,7 +297,9 @@ extends:
198
297
condition: succeeded()
199
298
200
299
- job : CreateMsixBundle
201
- dependsOn : BuildWin
300
+ dependsOn :
301
+ - BuildWin_x64
302
+ - BuildWin_arm64
202
303
variables :
203
304
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
204
305
ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
0 commit comments