| 1 | stages: |
| 2 | - stage: dcat_prepare |
| 3 | displayName: Prepare DCAT submissions |
| 4 | dependsOn: |
| 5 | - build_x64 |
| 6 | - build_arm64 |
| 7 | jobs: |
| 8 | - job: prepare |
| 9 | displayName: Generate DCAT submission metadata |
| 10 | pool: |
| 11 | type: windows |
| 12 | variables: |
| 13 | ob_outputDirectory: '$(Pipeline.Workspace)\dcat-output' |
| 14 | ob_artifactBaseName: drop_wsl |
| 15 | ob_artifactSuffix: _dcat |
| 16 | ob_sdl_checkcflags_enabled: false |
| 17 | DcatContentPath: '$(Pipeline.Workspace)\dcat' |
| 18 | buildStagePackageVersion: $[ stageDependencies.build_x64.build_x64.outputs['version.WSL_PACKAGE_VERSION'] ] |
| 19 | steps: |
| 20 | - checkout: releaseScripts |
| 21 | path: s\wsl-release-scripts |
| 22 | |
| 23 | - task: DownloadPipelineArtifact@2 |
| 24 | displayName: Download x64 build artifact |
| 25 | inputs: |
| 26 | artifact: drop_wsl_build |
| 27 | path: '$(Pipeline.Workspace)\drop_x64' |
| 28 | |
| 29 | - task: DownloadPipelineArtifact@2 |
| 30 | displayName: Download arm64 build artifact |
| 31 | inputs: |
| 32 | artifact: drop_wsl_build_arm64 |
| 33 | path: '$(Pipeline.Workspace)\drop_arm64' |
| 34 | |
| 35 | - task: PowerShell@2 |
| 36 | displayName: Generate DCAT submission metadata |
| 37 | inputs: |
| 38 | targetType: inline |
| 39 | failOnStderr: true |
| 40 | pwsh: true |
| 41 | script: | |
| 42 | $contentPath = '$(DcatContentPath)' |
| 43 | $outputPath = '$(ob_outputDirectory)' |
| 44 | $version = '$(buildStagePackageVersion)' |
| 45 | |
| 46 | New-Item -ItemType Directory -Path $contentPath -Force | Out-Null |
| 47 | Copy-Item "$(Pipeline.Workspace)\drop_x64\bundle\wsl.$version.x64.msi" $contentPath |
| 48 | Copy-Item "$(Pipeline.Workspace)\drop_x64\bundle\wsl.$version.x64.cab" $contentPath |
| 49 | Copy-Item "$(Pipeline.Workspace)\drop_arm64\bundle\wsl.$version.arm64.msi" $contentPath |
| 50 | Copy-Item "$(Pipeline.Workspace)\drop_arm64\bundle\wsl.$version.arm64.cab" $contentPath |
| 51 | |
| 52 | & "$(Pipeline.Workspace)\s\wsl-release-scripts\scripts\Dcat\New-DcatSubmission.ps1" ` |
| 53 | -ContentFolderPath $contentPath ` |
| 54 | -Version $version |
| 55 | |
| 56 | $jsonFiles = @(Get-ChildItem -Path $contentPath -Filter *.json) |
| 57 | if ($jsonFiles.Count -ne 10) { |
| 58 | throw "Expected 10 JSON files, found $($jsonFiles.Count)." |
| 59 | } |
| 60 | |
| 61 | New-Item -ItemType Directory -Path $outputPath -Force | Out-Null |
| 62 | Copy-Item $jsonFiles.FullName $outputPath |