microsoft/qdk
Publicmirrored fromhttps://github.com/microsoft/qdkAvailable
.ado/publish.yml
614lines · modecode
| 1 | name: qsharp-publish-$(BuildId) |
| 2 | |
| 3 | # Run on merges to main to ensure that the latest code |
| 4 | # is always able to be published. |
| 5 | trigger: |
| 6 | branches: |
| 7 | include: |
| 8 | - main |
| 9 | |
| 10 | # Run the pipeline every day at 6:00 AM to ensure |
| 11 | # codeql and other governance checks are up-to-date. |
| 12 | schedules: |
| 13 | - cron: "0 6 * * *" |
| 14 | displayName: 'Build for Component Governance' |
| 15 | branches: |
| 16 | include: |
| 17 | - main |
| 18 | always: true |
| 19 | |
| 20 | variables: |
| 21 | CARGO_TERM_COLOR: always |
| 22 | RUST_TOOLCHAIN_VERSION: "1.84" |
| 23 | |
| 24 | resources: |
| 25 | repositories: |
| 26 | - repository: 1ESPipelineTemplates |
| 27 | type: git |
| 28 | name: 1ESPipelineTemplates/1ESPipelineTemplates |
| 29 | ref: refs/tags/release |
| 30 | |
| 31 | parameters: |
| 32 | - name: matrix |
| 33 | type: object |
| 34 | default: |
| 35 | - name: linux_x86_64 |
| 36 | poolName: 'Azure-Pipelines-DevTools-EO' |
| 37 | imageName: 'ubuntu-22.04' |
| 38 | os: linux |
| 39 | arch: x86_64 |
| 40 | additionalTargets: wasm32-unknown-unknown |
| 41 | - name: linux_aarch64 |
| 42 | poolName: 'Azure-Pipelines-DevTools-ARM64-EO' |
| 43 | imageName: 'mariner-2.0-arm64' |
| 44 | os: linux |
| 45 | arch: aarch64 |
| 46 | additionalRustTargets: wasm32-unknown-unknown |
| 47 | - name: mac_universal |
| 48 | poolName: 'Azure Pipelines' |
| 49 | imageName: 'macOS-latest' # MacOS-specific Py (Mac is usually quite limited). |
| 50 | os: macOS |
| 51 | arch: x86_64 |
| 52 | additionalRustTargets: aarch64-apple-darwin wasm32-unknown-unknown |
| 53 | - name: windows_x86_64 |
| 54 | poolName: 'Azure-Pipelines-DevTools-EO' |
| 55 | imageName: 'windows-latest' # Win-specific Py + Platform-independent Py. |
| 56 | os: windows |
| 57 | arch: x86_64 |
| 58 | additionalTargets: wasm32-unknown-unknown |
| 59 | - name: windows_aarch64 |
| 60 | poolName: 'Azure-Pipelines-DevTools-ARM64-EO' |
| 61 | imageName: 'Windows-2022-ARM64' # Win-specific Py + Platform-independent Py. |
| 62 | os: windows |
| 63 | arch: aarch64 |
| 64 | additionalRustTargets: wasm32-unknown-unknown |
| 65 | |
| 66 | |
| 67 | # variables set by pipeline |
| 68 | # - BASE_IMAGE |
| 69 | # - BUILD_NUMBER |
| 70 | # - BUILD_TYPE |
| 71 | # - cratesIoFeedOverride |
| 72 | # - OwnerPersonalAlias |
| 73 | # - PAT |
| 74 | # - toolchainFeed |
| 75 | |
| 76 | extends: |
| 77 | template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates |
| 78 | parameters: |
| 79 | sdl: |
| 80 | sourceAnalysisPool: |
| 81 | name: 'Azure-Pipelines-DevTools-EO' |
| 82 | image: windows-2022 |
| 83 | os: windows |
| 84 | stages: |
| 85 | - stage: build |
| 86 | displayName: Build |
| 87 | jobs: |
| 88 | - job: "Node" |
| 89 | pool: |
| 90 | name: 'Azure-Pipelines-DevTools-EO' |
| 91 | image: 'ubuntu-latest' |
| 92 | os: linux |
| 93 | timeoutInMinutes: 90 |
| 94 | templateContext: |
| 95 | outputs: |
| 96 | - output: pipelineArtifact |
| 97 | displayName: 'Upload NPM Package Artifact' |
| 98 | targetPath: $(System.DefaultWorkingDirectory)/target/npm/qsharp |
| 99 | artifactName: NPM |
| 100 | condition: succeeded() |
| 101 | steps: |
| 102 | # common init steps |
| 103 | - task: RustInstaller@1 |
| 104 | inputs: |
| 105 | rustVersion: ms-$(RUST_TOOLCHAIN_VERSION) |
| 106 | additionalTargets: wasm32-unknown-unknown |
| 107 | cratesIoFeedOverride: $(cratesIoFeedOverride) |
| 108 | toolchainFeed: $(toolchainFeed) |
| 109 | displayName: Install Rust toolchain |
| 110 | |
| 111 | - task: UsePythonVersion@0 |
| 112 | inputs: |
| 113 | versionSpec: '3.11' |
| 114 | |
| 115 | - task: UseNode@1 |
| 116 | inputs: |
| 117 | version: "20.x" |
| 118 | |
| 119 | - script: | |
| 120 | python ./prereqs.py --install && python ./version.py |
| 121 | displayName: Install Prereqs and set version |
| 122 | |
| 123 | # build steps |
| 124 | |
| 125 | - script: | |
| 126 | python build.py --npm --wasm --no-check-prereqs |
| 127 | displayName: Build VSCode Extension |
| 128 | |
| 129 | - script: | |
| 130 | mkdir -p $(System.DefaultWorkingDirectory)/target/npm/qsharp |
| 131 | npm pack --pack-destination $(System.DefaultWorkingDirectory)/target/npm/qsharp |
| 132 | displayName: Pack NPM Package |
| 133 | workingDirectory: $(System.DefaultWorkingDirectory)/npm/qsharp |
| 134 | |
| 135 | - job: "VSCode" |
| 136 | pool: |
| 137 | name: 'Azure-Pipelines-DevTools-EO' |
| 138 | image: 'ubuntu-latest' |
| 139 | os: linux |
| 140 | timeoutInMinutes: 90 |
| 141 | templateContext: |
| 142 | outputs: |
| 143 | - output: pipelineArtifact |
| 144 | displayName: 'Upload VSCode Extension Artifact' |
| 145 | targetPath: $(System.DefaultWorkingDirectory)/target/vscode |
| 146 | artifactName: VSIX |
| 147 | condition: succeeded() |
| 148 | steps: |
| 149 | # common init steps |
| 150 | - task: RustInstaller@1 |
| 151 | inputs: |
| 152 | rustVersion: ms-$(RUST_TOOLCHAIN_VERSION) |
| 153 | additionalTargets: wasm32-unknown-unknown |
| 154 | cratesIoFeedOverride: $(cratesIoFeedOverride) |
| 155 | toolchainFeed: $(toolchainFeed) |
| 156 | displayName: Install Rust toolchain |
| 157 | |
| 158 | - task: UsePythonVersion@0 |
| 159 | inputs: |
| 160 | versionSpec: '3.11' |
| 161 | |
| 162 | - task: UseNode@1 |
| 163 | inputs: |
| 164 | version: "20.x" |
| 165 | |
| 166 | - script: | |
| 167 | python ./prereqs.py --install && python ./version.py |
| 168 | displayName: Install Prereqs and set version |
| 169 | |
| 170 | # Below VS Code extension build only needs to run on one platform (Linux x86_64 for now) |
| 171 | - script: | |
| 172 | npm install -g @vscode/vsce |
| 173 | displayName: Install Prereqs for VSCode Extension |
| 174 | |
| 175 | # build steps |
| 176 | |
| 177 | - script: | |
| 178 | python build.py --wasm --npm --vscode --integration-tests --no-check-prereqs |
| 179 | displayName: Build VSCode Extension |
| 180 | |
| 181 | - script: | |
| 182 | vsce package --pre-release |
| 183 | mkdir -p $(System.DefaultWorkingDirectory)/target/vscode |
| 184 | mv *.vsix $(System.DefaultWorkingDirectory)/target/vscode |
| 185 | condition: and(succeeded(), eq(variables['BUILD_TYPE'], 'dev')) |
| 186 | displayName: Pack pre-release VSCode Extension |
| 187 | workingDirectory: '$(System.DefaultWorkingDirectory)/vscode' |
| 188 | |
| 189 | - script: | |
| 190 | vsce package |
| 191 | mkdir -p $(System.DefaultWorkingDirectory)/target/vscode |
| 192 | mv *.vsix $(System.DefaultWorkingDirectory)/target/vscode |
| 193 | condition: and(succeeded(), ne(variables['BUILD_TYPE'], 'dev')) |
| 194 | displayName: Pack VSCode Extension |
| 195 | workingDirectory: '$(System.DefaultWorkingDirectory)/vscode' |
| 196 | |
| 197 | - job: "JupyterLab" |
| 198 | pool: |
| 199 | name: 'Azure-Pipelines-DevTools-EO' |
| 200 | image: 'ubuntu-latest' |
| 201 | os: linux |
| 202 | timeoutInMinutes: 90 |
| 203 | templateContext: |
| 204 | outputs: |
| 205 | - output: pipelineArtifact |
| 206 | displayName: 'Upload JupyterLab Python Artifacts' |
| 207 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels/ |
| 208 | artifactName: Wheels.JupyterLab |
| 209 | condition: succeeded() |
| 210 | steps: |
| 211 | # common init steps |
| 212 | - task: RustInstaller@1 |
| 213 | inputs: |
| 214 | rustVersion: ms-$(RUST_TOOLCHAIN_VERSION) |
| 215 | cratesIoFeedOverride: $(cratesIoFeedOverride) |
| 216 | toolchainFeed: $(toolchainFeed) |
| 217 | displayName: Install Rust toolchain |
| 218 | |
| 219 | - task: UsePythonVersion@0 |
| 220 | inputs: |
| 221 | versionSpec: '3.11' |
| 222 | |
| 223 | - task: UseNode@1 |
| 224 | inputs: |
| 225 | version: "20.x" |
| 226 | |
| 227 | - script: | |
| 228 | python ./prereqs.py --skip-wasm && python ./version.py |
| 229 | displayName: Install Prereqs and set version |
| 230 | |
| 231 | - script: | |
| 232 | python ./build.py --jupyterlab --widgets --no-check --no-check-prereqs |
| 233 | displayName: Build JupyterLab Package |
| 234 | |
| 235 | - script: | |
| 236 | ls target/wheels/* |
| 237 | |
| 238 | - ${{ each target in parameters.matrix }}: |
| 239 | - job: Python_${{ target.name }}_job |
| 240 | pool: |
| 241 | name: ${{ target.poolName }} |
| 242 | image: ${{ target.imageName }} |
| 243 | os: ${{ target.os }} |
| 244 | ${{ if eq(target.arch, 'aarch64') }}: |
| 245 | hostArchitecture: Arm64 |
| 246 | variables: |
| 247 | arch: ${{ target.arch }} |
| 248 | additionalRustTargets: ${{ target.additionalRustTargets }} |
| 249 | timeoutInMinutes: 90 |
| 250 | templateContext: |
| 251 | outputs: |
| 252 | - output: pipelineArtifact |
| 253 | displayName: 'Upload Python Artifacts Mac' |
| 254 | condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) |
| 255 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 256 | artifactName: Wheels.Mac |
| 257 | - output: pipelineArtifact |
| 258 | displayName: 'Upload Python Artifacts Win' |
| 259 | condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) |
| 260 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 261 | artifactName: Wheels.Win.${{ target.arch }} |
| 262 | - output: pipelineArtifact |
| 263 | displayName: 'Upload Python Artifacts Linux' |
| 264 | condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) |
| 265 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 266 | artifactName: Wheels.Linux.${{ target.arch }} |
| 267 | steps: |
| 268 | # common init steps |
| 269 | # if we have additional rust targets, we need to install them |
| 270 | - task: RustInstaller@1 |
| 271 | inputs: |
| 272 | rustVersion: ms-$(RUST_TOOLCHAIN_VERSION) |
| 273 | additionalTargets: $(additionalRustTargets) |
| 274 | cratesIoFeedOverride: $(cratesIoFeedOverride) |
| 275 | toolchainFeed: $(toolchainFeed) |
| 276 | displayName: Install Rust toolchain |
| 277 | condition: ne(variables['additionalRustTargets'], '') |
| 278 | |
| 279 | # otherwise just install the default toolchain |
| 280 | - task: RustInstaller@1 |
| 281 | inputs: |
| 282 | rustVersion: ms-$(RUST_TOOLCHAIN_VERSION) |
| 283 | cratesIoFeedOverride: $(cratesIoFeedOverride) |
| 284 | toolchainFeed: $(toolchainFeed) |
| 285 | displayName: Install Rust toolchain |
| 286 | condition: eq(variables['additionalRustTargets'], '') |
| 287 | |
| 288 | - script: | |
| 289 | rustc --version |
| 290 | rustc --print target-list |
| 291 | displayName: View rust target info |
| 292 | |
| 293 | # official docs say `UsePythonVersion` only supports x86/x64 for arch |
| 294 | # but we can set it to arm64 on windows and it will work. |
| 295 | # we can't do this for linux because they only have ubuntu 20.04/22.04 |
| 296 | # pre-built images for arm64. so we need another way to install python. |
| 297 | - task: UsePythonVersion@0 |
| 298 | inputs: |
| 299 | versionSpec: '3.11.9' |
| 300 | architecture: 'arm64' |
| 301 | condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['arch'], 'aarch64')) |
| 302 | |
| 303 | - task: UsePythonVersion@0 |
| 304 | inputs: |
| 305 | versionSpec: '3.11' |
| 306 | condition: ne(variables['arch'], 'aarch64') |
| 307 | |
| 308 | - task: UseNode@1 |
| 309 | inputs: |
| 310 | version: "20.x" |
| 311 | |
| 312 | # For arm64 windows we need to install the c++ build tools |
| 313 | - task: PowerShell@2 |
| 314 | inputs: |
| 315 | targetType: 'inline' |
| 316 | script: | |
| 317 | # $paths_to_check = @("C:\vss-agent\4.251.0", "C:\ToolCache", "C:\Program Files (Arm)\", "C:\Program Files (x86)\") |
| 318 | # foreach ($path in $paths_to_check) { |
| 319 | # Write-Host "Checking for $path" |
| 320 | # Get-ChildItem -Path $path -Recurse -Filter "*.exe" | ForEach-Object { Write-Host $_.FullName } |
| 321 | # } |
| 322 | #Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" -Recurse | ForEach-Object { Write-Host $_.FullName } |
| 323 | $vswhere = "C:\vss-agent\4.251.0\externals\vswhere\vswhere.exe" |
| 324 | & $vswhere -legacy -prerelease -format json |
| 325 | & $vswhere -legacy -prerelease |
| 326 | # Get all environment variables |
| 327 | # $envVars = Get-ChildItem Env: |
| 328 | # foreach ($envVar in $envVars) { |
| 329 | # Write-Host "$($envVar.Name) = $($envVar.Value)" |
| 330 | # $path = "$($envVar.Value)" |
| 331 | # if (![string]::IsNullOrEmpty($path) -and (Test-Path $path)) { |
| 332 | # Write-Host "Checking for $path" |
| 333 | # try { |
| 334 | # Get-ChildItem -Path $path -Recurse -Filter "*.exe" -ErrorAction Continue | ForEach-Object { Write-Host $_.FullName } |
| 335 | # } catch { |
| 336 | # Write-Host "Error encountered: $_" |
| 337 | # } |
| 338 | # } |
| 339 | # } |
| 340 | # Search for vswhere.exe on the C:\ drive |
| 341 | # $vswherePath = @(Get-ChildItem -Path C:\ -Filter "vswhere.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName) |
| 342 | # foreach ($path in $vswherePath) { |
| 343 | # Write-Host "Found vswhere.exe at: $path" |
| 344 | # } |
| 345 | # Search for tools on the C:\ drive |
| 346 | # only vswhere is found.... |
| 347 | # $tools = @("vs_enterprise.exe", "vs_professional.exe", "vs_community.exe", "vs_buildtools.exe", "vs_installer.exe", "vswhere.exe") |
| 348 | # foreach ($tool in $tools) { |
| 349 | # Write-Host "Searching for $tool on the C:\ drive..." |
| 350 | # $path = @(Get-ChildItem -Path C:\ -Filter $tool -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName) |
| 351 | # foreach ($p in $path) { |
| 352 | # Write-Host "Found $tool at: $p" |
| 353 | # } |
| 354 | # } |
| 355 | # Get the path stored in the AGENT_HOMEDIRECTORY environment variable |
| 356 | # $agentHomeDirectory = $env:AGENT_HOMEDIRECTORY |
| 357 | |
| 358 | # if ($agentHomeDirectory) { |
| 359 | # # Search for vswhere.exe in the AGENT_HOMEDIRECTORY directory |
| 360 | # $vswherePath = Get-ChildItem -Path $agentHomeDirectory -Filter "vswhere.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName |
| 361 | |
| 362 | # if ($vswherePath) { |
| 363 | # Write-Host "Found vswhere.exe at: $vswherePath" |
| 364 | # $vs_installer = & $vswherePath -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find vs_installer.exe |
| 365 | # if ($vs_installer) { |
| 366 | # & $vs_installer modify --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --passive --norestart |
| 367 | # } else { |
| 368 | # Write-Host "vs_installer.exe not found." |
| 369 | # } |
| 370 | # } else { |
| 371 | # Write-Host "vswhere.exe not found in AGENT_HOMEDIRECTORY." |
| 372 | # } |
| 373 | # } else { |
| 374 | # Write-Host "AGENT_HOMEDIRECTORY environment variable is not set." |
| 375 | # } |
| 376 | # if ($vswherePath) { |
| 377 | # Write-Host "Found vswhere.exe at: $vswherePath" |
| 378 | # # Check each environment variable as a folder |
| 379 | # foreach ($envVar in [System.Environment]::GetEnvironmentVariables().Keys) { |
| 380 | # $envPath = [System.Environment]::GetEnvironmentVariable($envVar) |
| 381 | # if ($envPath -and (Test-Path $envPath)) { |
| 382 | # $fullPath = Join-Path -Path $envPath -ChildPath "vswhere.exe" |
| 383 | # if (Test-Path $fullPath) { |
| 384 | # Write-Host "vswhere.exe found in environment variable path: $envVar" |
| 385 | # } |
| 386 | # } |
| 387 | # } |
| 388 | # } else { |
| 389 | # Write-Host "vswhere.exe not found on the C:\ drive." |
| 390 | # } |
| 391 | #$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" |
| 392 | #& $vswhere --wait --passive --norestart --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.Llvm.Clang |
| 393 | displayName: Install C++ Build Tools on Windows Arm64 |
| 394 | condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['arch'], 'aarch64')) |
| 395 | |
| 396 | # on mariner we need to install: |
| 397 | # ld with binutils |
| 398 | # crt1.o and others with glibc-devel |
| 399 | # std lib headers with kernel-headers |
| 400 | - script: | |
| 401 | sudo tdnf install binutils glibc-devel kernel-headers -y |
| 402 | displayName: Install c++ build tools on mariner |
| 403 | condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['arch'], 'aarch64')) |
| 404 | |
| 405 | - script: | |
| 406 | python ./version.py |
| 407 | displayName: Set version |
| 408 | |
| 409 | # For arm64 linux(mariner) we need to use the python already installed |
| 410 | # so we skip the prereqs check |
| 411 | # For arm64 windows rustup is not present in the image so we need to skip prereqs check too |
| 412 | - script: | |
| 413 | python ./prereqs.py --skip-wasm |
| 414 | displayName: Check Prereqs |
| 415 | condition: and(not(and(eq(variables['Agent.OS'], 'Linux'), eq(variables['arch'], 'aarch64'))), not(and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['arch'], 'aarch64')))) |
| 416 | |
| 417 | - script: | |
| 418 | python build.py --pip --no-check-prereqs --integration-tests |
| 419 | displayName: Build Platform-Dependent Py Packages |
| 420 | |
| 421 | - script: | |
| 422 | # use a venv to make sure the installed tools are on the path |
| 423 | python -m venv venv |
| 424 | source venv/bin/activate |
| 425 | |
| 426 | # install tools into the venv |
| 427 | python -m pip install auditwheel patchelf |
| 428 | |
| 429 | # repair the wheels |
| 430 | ls target/wheels/*.whl |
| 431 | for wheel in target/wheels/*.whl; do |
| 432 | echo "Processing $wheel" |
| 433 | auditwheel show "$wheel" |
| 434 | auditwheel repair --wheel-dir ./target/wheels/ --plat manylinux_2_35_${{ target.arch }} "$wheel" |
| 435 | done |
| 436 | # remove the original wheels |
| 437 | rm target/wheels/*-linux_${{ target.arch }}.whl |
| 438 | # list the wheels for debugging |
| 439 | ls target/wheels/*.whl |
| 440 | displayName: Run auditwheel for Linux Wheels |
| 441 | condition: eq(variables['Agent.OS'], 'Linux') |
| 442 | |
| 443 | - script: | |
| 444 | dir target\wheels\* |
| 445 | displayName: List Py Packages on Win |
| 446 | condition: eq(variables['Agent.OS'], 'Windows_NT') |
| 447 | |
| 448 | - script: | |
| 449 | ls target/wheels/* |
| 450 | displayName: List Py Packages on non-Win |
| 451 | condition: ne(variables['Agent.OS'], 'Windows_NT') |
| 452 | |
| 453 | - stage: approval |
| 454 | displayName: Approval |
| 455 | dependsOn: build |
| 456 | condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual')) |
| 457 | jobs: |
| 458 | - job: "Approval" |
| 459 | pool: server |
| 460 | timeoutInMinutes: 1440 # job times out in 1 day |
| 461 | steps: |
| 462 | - task: ManualValidation@0 |
| 463 | timeoutInMinutes: 1440 # task times out in 1 day |
| 464 | inputs: |
| 465 | notifyUsers: '' |
| 466 | instructions: 'Please verify artifacts and approve the release' |
| 467 | onTimeout: 'reject' |
| 468 | |
| 469 | - stage: release |
| 470 | displayName: Release |
| 471 | dependsOn: approval |
| 472 | condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual')) |
| 473 | jobs: |
| 474 | - job: "Publish_VSIX_Package" |
| 475 | pool: |
| 476 | name: 'Azure-Pipelines-DevTools-EO' |
| 477 | image: 'ubuntu-latest' |
| 478 | os: linux |
| 479 | templateContext: |
| 480 | type: releaseJob |
| 481 | isProduction: true |
| 482 | inputs: # All input build artifacts must be declared here |
| 483 | - input: pipelineArtifact |
| 484 | artifactName: VSIX |
| 485 | targetPath: $(System.DefaultWorkingDirectory)/target/vscode |
| 486 | steps: |
| 487 | - script: | |
| 488 | npm install -g @vscode/vsce |
| 489 | displayName: Install Prereqs for VSCode Ext Publishing |
| 490 | |
| 491 | - script: | |
| 492 | VSIX_RPATH="$(System.DefaultWorkingDirectory)/target/vscode" |
| 493 | VSIX_FNAME=`ls $VSIX_RPATH/*.vsix` |
| 494 | echo "RPATH: $VSIX_RPATH" |
| 495 | echo "FNAME: $VSIX_FNAME" |
| 496 | vsce publish --pre-release --packagePath $VSIX_FNAME 2>&1 > pub.log |
| 497 | condition: and(succeeded(), eq(variables['BUILD_TYPE'], 'dev')) |
| 498 | displayName: Publish pre-release VSCode Extension |
| 499 | env: |
| 500 | VSCE_PAT: $(PAT) |
| 501 | |
| 502 | - script: | |
| 503 | VSIX_RPATH="$(System.DefaultWorkingDirectory)/target/vscode" |
| 504 | VSIX_FNAME=`ls $VSIX_RPATH/*.vsix` |
| 505 | echo "RPATH: $VSIX_RPATH" |
| 506 | echo "FNAME: $VSIX_FNAME" |
| 507 | vsce publish --packagePath $VSIX_FNAME 2>&1 > pub.log |
| 508 | condition: and(succeeded(), ne(variables['BUILD_TYPE'], 'dev')) |
| 509 | displayName: Publish VSCode Extension |
| 510 | env: |
| 511 | VSCE_PAT: $(PAT) |
| 512 | |
| 513 | - script: | |
| 514 | dir |
| 515 | cat pub.log |
| 516 | displayName: If failed, display VSCode Publishing Results |
| 517 | condition: failed() |
| 518 | workingDirectory: '$(System.DefaultWorkingDirectory)' |
| 519 | |
| 520 | |
| 521 | # We will get a warning about extra files in the sbom validation saying it failed. |
| 522 | # This is expected as we have the wheels being downloaded to the same directory. |
| 523 | # So each successive wheel will have the previous wheel in the directory and each |
| 524 | # will be flagged as an extra file. See: |
| 525 | # http://aka.ms/drop-validation-failure-additional-files |
| 526 | - job: "Publish_Python_Packages" |
| 527 | pool: |
| 528 | name: 'Azure-Pipelines-DevTools-EO' |
| 529 | image: 'ubuntu-latest' |
| 530 | os: linux |
| 531 | templateContext: |
| 532 | type: releaseJob |
| 533 | isProduction: true |
| 534 | inputs: # All input build artifacts must be declared here |
| 535 | - input: pipelineArtifact |
| 536 | artifactName: Wheels.Win.x86_64 |
| 537 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 538 | - input: pipelineArtifact |
| 539 | artifactName: Wheels.Win.aarch64 |
| 540 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 541 | - input: pipelineArtifact |
| 542 | artifactName: Wheels.Mac |
| 543 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 544 | - input: pipelineArtifact |
| 545 | artifactName: Wheels.Linux.x86_64 |
| 546 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 547 | - input: pipelineArtifact |
| 548 | artifactName: Wheels.Linux.aarch64 |
| 549 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 550 | - input: pipelineArtifact |
| 551 | artifactName: Wheels.JupyterLab |
| 552 | targetPath: $(System.DefaultWorkingDirectory)/target/wheels |
| 553 | steps: |
| 554 | - script: | |
| 555 | ls $(System.DefaultWorkingDirectory)/target/wheels |
| 556 | displayName: Display Py Artifacts in Publishing Dir |
| 557 | |
| 558 | - task: EsrpRelease@7 |
| 559 | condition: succeeded() |
| 560 | inputs: |
| 561 | ConnectedServiceName: 'ESRP Signing Connection' |
| 562 | KeyVaultName: 'kv-aqua-esrp-001' |
| 563 | AuthCertName: 'EsrpAuthCert' |
| 564 | SignCertName: 'EsrpSignCert' |
| 565 | ClientId: '832c049d-cd07-4c1c-bfa5-c07250d190cb' |
| 566 | Intent: 'PackageDistribution' |
| 567 | ContentType: 'PyPi' |
| 568 | FolderLocation: '$(System.DefaultWorkingDirectory)/target/wheels' |
| 569 | WaitForReleaseCompletion: true |
| 570 | Owners: '$(OwnerPersonalAlias)@microsoft.com' # NB: Group email here fails the task with non-actionable output. |
| 571 | Approvers: 'billti@microsoft.com' |
| 572 | # Auto-inserted Debugging defaults: |
| 573 | ServiceEndpointUrl: 'https://api.esrp.microsoft.com' |
| 574 | MainPublisher: 'ESRPRELPACMAN' # Default ESRP v7 publisher. Do not change. |
| 575 | DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' |
| 576 | displayName: Publish Py Packages |
| 577 | |
| 578 | |
| 579 | - job: "Publish_NPM_Package" |
| 580 | pool: |
| 581 | name: 'Azure-Pipelines-DevTools-EO' |
| 582 | image: 'ubuntu-latest' |
| 583 | os: linux |
| 584 | templateContext: |
| 585 | type: releaseJob |
| 586 | isProduction: true |
| 587 | inputs: # All input build artifacts must be declared here |
| 588 | - input: pipelineArtifact |
| 589 | artifactName: NPM |
| 590 | targetPath: $(System.DefaultWorkingDirectory)/target/npm/qsharp |
| 591 | steps: |
| 592 | - script: | |
| 593 | ls $(System.DefaultWorkingDirectory)/target/npm/qsharp/* |
| 594 | displayName: Display NPM Artifacts in Publishing Dir |
| 595 | |
| 596 | - task: EsrpRelease@7 |
| 597 | condition: succeeded() |
| 598 | inputs: |
| 599 | ConnectedServiceName: 'ESRP Signing Connection' |
| 600 | KeyVaultName: 'kv-aqua-esrp-001' |
| 601 | AuthCertName: 'EsrpAuthCert' |
| 602 | SignCertName: 'EsrpSignCert' |
| 603 | ClientId: '832c049d-cd07-4c1c-bfa5-c07250d190cb' |
| 604 | Intent: 'PackageDistribution' |
| 605 | ContentType: 'NPM' |
| 606 | FolderLocation: '$(System.DefaultWorkingDirectory)/target/npm/qsharp' |
| 607 | WaitForReleaseCompletion: true |
| 608 | Owners: '$(OwnerPersonalAlias)@microsoft.com' # NB: Group email here fails the task with non-actionable output. |
| 609 | Approvers: 'billti@microsoft.com' |
| 610 | # Auto-inserted Debugging defaults: |
| 611 | ServiceEndpointUrl: 'https://api.esrp.microsoft.com' |
| 612 | MainPublisher: 'ESRPRELPACMAN' # Default ESRP v7 publisher. Do not change. |
| 613 | DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' |
| 614 | displayName: Publish NPM Package |
| 615 | |