@@ -18,7 +18,6 @@ schedules:
18
18
variables :
19
19
BuildConfiguration : ' release'
20
20
PackageRoot : ' $(System.ArtifactsDirectory)/Packages'
21
- # LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0'
22
21
WindowsContainerImage : ' onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
23
22
Codeql.TSAEnabled : true
24
23
@@ -85,120 +84,46 @@ extends:
85
84
Write-Host "##$vstsCommandString"
86
85
name: Package
87
86
88
- - job : BuildWin
87
+ - job : BuildWin_x64
89
88
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
89
variables :
99
- PackageVersion : $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
100
90
ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
101
91
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
102
- ob_artifactSuffix : $(Suffix)
103
- repoRoot : ' $(Build.SourcesDirectory)\DSC'
104
92
signSrcPath : ' $(Build.SourcesDirectory)\out'
105
93
ob_sdl_sbom_enabled : true
106
94
ob_signing_setup_enabled : true
107
95
ob_sdl_codeql_compiled_enabled : true
108
96
pool :
109
97
type : windows
110
- displayName : BuildWin
111
98
steps :
112
- - checkout : self
113
- env :
114
- ob_restore_phase : true
115
- - task : CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step.
116
- inputs :
117
- Enabled : true
118
- AnalyzeInPipeline : true
119
- Language : rust
120
- env :
121
- ob_restore_phase : true
122
- - pwsh : |
123
- $tmpdir = "$(Agent.TempDirectory)"
124
- Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir"
125
- displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue
126
- env:
127
- ob_restore_phase: true
128
- - task : RustInstaller@1
129
- inputs :
130
- rustVersion : ms-stable
131
- toolchainFeed : https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
132
- additionalTargets : $(buildName)
133
- displayName : Install Rust
134
- env :
135
- ob_restore_phase : true
136
- - pwsh : |
137
- Set-Location "$(Build.SourcesDirectory)/DSC"
138
- $LLVMBIN = "$($env:PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\bin"
139
- if (!(Test-Path $LLVMBIN)) {
140
- throw "LLVM path '$LLVMBIN' does not exist"
141
- }
142
- $env:PATH += ";$LLVMBIN"
143
- write-verbose -verbose (gcm clang.exe | out-string)
144
- ./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck
145
- displayName: 'Build $(buildName)'
146
- env:
147
- ob_restore_phase: true
148
- condition: succeeded()
149
- - task : CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step.
150
- condition : always()
151
- env :
152
- ob_restore_phase : true
153
- - pwsh : |
154
- $null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore
155
- $null = New-Item -ItemType Directory -Path "$(PackageRoot)/out" -ErrorAction Ignore
156
- $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
157
- # workaround known issue of building in OneBranch copying from TMP folder
158
- $null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore
159
- # copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign
160
- write-host 'Binaries in $(env:CARGO_TARGET_DIR)'
161
- Copy-Item -Path "$env:CARGO_TARGET_DIR/$(buildName)/$(BuildConfiguration)/*.exe" -Destination "$(signSrcPath)" -Verbose
162
- Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Recurse -Destination "$(signSrcPath)" -Verbose -Force
163
- write-host 'Binaries in $(signSrcPath)'
164
- dir -r "$(signSrcPath)"
165
- displayName: Copy built binaries
166
- env:
167
- ob_restore_phase: true
168
- condition: succeeded()
169
- - task : onebranch.pipeline.signing@1
170
- displayName : Sign 1st party files
171
- inputs :
172
- command : ' sign'
173
- signing_profile : external_distribution
174
- files_to_sign : |
175
- **\*.exe;
176
- **\*.ps1;
177
- **\*.psd1;
178
- **\*.psm1;
179
- search_root : $(signSrcPath)
180
- - task : CopyFiles@2
181
- displayName : " Copy signed files to build target dir"
182
- inputs :
183
- SourceFolder : " $(signSrcPath)"
184
- Contents : ' **'
185
- TargetFolder : $(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)
186
- OverWrite : true
187
- - pwsh : |
188
- Set-Location "$(Build.SourcesDirectory)/DSC"
189
- ./build.ps1 -PackageType zip -Architecture $(buildName) -Release
190
- Copy-Item ./bin/*.zip "$(ob_outputDirectory)"
191
- displayName: 'Zip $(buildName)'
192
- condition: succeeded()
193
- - pwsh : |
194
- Set-Location "$(Build.SourcesDirectory)/DSC"
195
- ./build.ps1 -PackageType msix -Architecture $(buildName) -Release -UseX64MakeAppx
196
- Copy-Item ./bin/msix/*.msix "$(ob_outputDirectory)" -Verbose
197
- displayName: 'Create msix for $(buildName)'
198
- condition: succeeded()
99
+ - template : .pipelines/DSC-Windows.yml@self
100
+ parameters :
101
+ buildName : x86_64-pc-windows-msvc
102
+ signSrcPath : ' $(signSrcPath)'
103
+ PackageRoot : ' $(PackageRoot)'
104
+
105
+ - job : BuildWin_arm64
106
+ dependsOn : SetPackageVersion
107
+ variables :
108
+ ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
109
+ ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
110
+ signSrcPath : ' $(Build.SourcesDirectory)\out'
111
+ ob_sdl_sbom_enabled : true
112
+ ob_signing_setup_enabled : true
113
+ ob_sdl_codeql_compiled_enabled : true
114
+ pool :
115
+ type : windows
116
+ steps :
117
+ - template : .pipelines/DSC-Windows.yml@self
118
+ parameters :
119
+ buildName : aarch64-pc-windows-msvc
120
+ signSrcPath : ' $(signSrcPath)'
121
+ PackageRoot : ' $(PackageRoot)'
199
122
200
123
- job : CreateMsixBundle
201
- dependsOn : BuildWin
124
+ dependsOn :
125
+ - BuildWin_x64
126
+ - BuildWin_arm64
202
127
variables :
203
128
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)'
204
129
ob_sdl_tsa_configFile : ' $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json'
@@ -210,77 +135,21 @@ extends:
210
135
steps :
211
136
- checkout : self
212
137
- download : current
213
- artifact : drop_BuildAndSign_BuildWinx64
138
+ artifact : drop_BuildAndSign_BuildWin_x64
214
139
patterns : ' *.msix'
215
140
- download : current
216
- artifact : drop_BuildAndSign_BuildWinarm64
141
+ artifact : drop_BuildAndSign_BuildWin_arm64
217
142
patterns : ' *.msix'
218
143
- pwsh : |
219
144
Set-Location "$(Build.SourcesDirectory)/DSC"
220
145
$null = New-Item -ItemType Directory -Path "./bin/msix" -Force -ErrorAction Ignore
221
- Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWinx64 /*.msix" ./bin/msix -Verbose
222
- Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWinarm64 /*.msix" ./bin/msix -Verbose
146
+ Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWin_x64 /*.msix" ./bin/msix -Verbose
147
+ Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWin_arm64 /*.msix" ./bin/msix -Verbose
223
148
./build.ps1 -PackageType msixbundle
224
149
Copy-Item ./bin/*.msixbundle "$(ob_outputDirectory)"
225
150
displayName: 'Create msixbundle'
226
151
condition: succeeded()
227
152
228
- # - job: BuildLinux
229
- # dependsOn: SetPackageVersion
230
- # variables:
231
- # LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
232
- # PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
233
- # ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
234
- # displayName: Linux-x64-gnu
235
- # pool:
236
- # type: linux
237
- # steps:
238
- # - task: RustInstaller@1
239
- # inputs:
240
- # rustVersion: ms-stable
241
- # toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
242
- # additionalTargets: x86_64-unknown-linux-gnu
243
- # displayName: Install Rust
244
- # env:
245
- # ob_restore_phase: true
246
- # - pwsh: |
247
- # ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu
248
- # ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release
249
- # Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
250
- # displayName: 'Build x86_64-unknown-linux-gnu'
251
- # condition: succeeded()
252
-
253
- # - job: BuildLinuxArm64
254
- # dependsOn: SetPackageVersion
255
- # variables:
256
- # LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest'
257
- # PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
258
- # ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
259
- # displayName: Linux-ARM64-gnu
260
- # pool:
261
- # type: linux
262
- # hostArchitecture: arm64
263
- # steps:
264
- # - task: RustInstaller@1
265
- # inputs:
266
- # rustVersion: ms-stable
267
- # toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json
268
- # additionalTargets: aarch64-unknown-linux-gnu
269
- # displayName: Install Rust
270
- # env:
271
- # ob_restore_phase: true
272
- # - pwsh: |
273
- # apt update
274
- # apt -y install gcc-aarch64-linux-gnu
275
- # if ((openssl version -d) -match 'OPENSSLDIR: "(?<dir>.*?)"') {
276
- # $env:OPENSSL_LIB_DIR = $matches['dir']
277
- # }
278
- # ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
279
- # ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
280
- # Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
281
- # displayName: 'Build aarch64-unknown-linux-gnu'
282
- # condition: succeeded()
283
-
284
153
- job : BuildLinuxMusl
285
154
dependsOn : SetPackageVersion
286
155
variables :
0 commit comments