diff --git a/Build/templates/build.yml b/Build/templates/build.yml index 3954d66b81..cf3e821b3a 100644 --- a/Build/templates/build.yml +++ b/Build/templates/build.yml @@ -16,3 +16,47 @@ steps: msbuildArguments: ' /p:VSTarget=$(VSTarget) /p:BuildNumber=${{ parameters.ptvsPackageVersion }} /bl:$(Build.SourcesDirectory)\logs\BuildProduct.binlog' + + # The publish SBOM tasks have been removed because they are generated and published automatically by the pipeline + # https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sbom + # Non-PR steps + - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: + + # Generate the bill of materials + # This must be done AFTER building binaries, but BEFORE building the installer + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'Generate bill of materials' + inputs: + BuildDropPath: '$(Build.BinariesDirectory)\layout' + PackageName: 'PTVS' + PackageVersion: '$(VSTarget)' + continueOnError: true + + # Build the tests (skip for PR builds since tests are not run in this pipeline) + - task: MSBuild@1 + displayName: 'Build tests' + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + inputs: + solution: $(Build.SourcesDirectory)/Python/Tests/dirs.proj + msbuildVersion: $(MsBuildVersion) + platform: $(Platform) + configuration: $(BuildConfiguration) + msbuildArguments: ' /p:VSTarget=$(VSTarget) + /p:BuildNumber=${{ parameters.ptvsPackageVersion }} + /bl:$(Build.SourcesDirectory)\logs\BuildTests.binlog' + + # Build the installer (skip for PR builds since no VstsDrop upload is needed) + - task: MSBuild@1 + displayName: 'Build installer' + condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + inputs: + solution: $(Build.SourcesDirectory)/Python/Setup/dirs.proj + msbuildVersion: $(MsBuildVersion) + platform: $(Platform) + configuration: $(BuildConfiguration) + msbuildArguments: ' /p:SkipProduct=true + /p:VSTarget=$(VSTarget) + /p:BuildNumber=${{ parameters.ptvsPackageVersion }} + /p:BUILD_BINARIESDIRECTORY=$(Build.BinariesDirectory) + /p:BUILD_STAGINGDIRECTORY=$(Build.StagingDirectory) + /bl:$(Build.SourcesDirectory)\logs\BuildInstaller.binlog' diff --git a/Build/templates/run_tests.yml b/Build/templates/run_tests.yml index 860881b0ea..c92b0d71e3 100644 --- a/Build/templates/run_tests.yml +++ b/Build/templates/run_tests.yml @@ -50,18 +50,15 @@ steps: failOnStderr: true pythonInterpreter: $(PYTHON_INTERPRETER) - # Download binaries from the build job instead of rebuilding - - download: current - artifact: Binaries - displayName: 'Download build binaries' - - # Copy downloaded binaries to the expected location - - powershell: | - $source = '$(Pipeline.Workspace)\Binaries' - $dest = '$(Build.BinariesDirectory)\raw\binaries' - New-Item -ItemType Directory -Force -Path $dest | Out-Null - Copy-Item -Path "$source\*" -Destination $dest -Recurse -Force - displayName: 'Copy binaries to expected location' + # Build the product + - task: MSBuild@1 + displayName: 'Build product' + inputs: + solution: $(Build.SourcesDirectory)/Python/Product/dirs.proj + msbuildVersion: $(MsBuildVersion) + platform: $(Platform) + configuration: $(BuildConfiguration) + msbuildArguments: '/p:VSTarget=$(VSTarget) /bl:$(Build.SourcesDirectory)\logs\BuildProduct.binlog' - task: CacheBeta@2 displayName: 'Restore glass binaries from cache' diff --git a/azure-pipelines-compliance.yml b/azure-pipelines-compliance.yml index 4ce2576cf0..5e241d6942 100644 --- a/azure-pipelines-compliance.yml +++ b/azure-pipelines-compliance.yml @@ -35,10 +35,10 @@ jobs: # The agent pool the build will run on pool: - name: VSEng-MicroBuildVSStable + name: VSEngSS-MicroBuild2022-1ES demands: - msbuild - - VisualStudio_18.0 + - VisualStudio_17.0 # Job variables variables: @@ -47,7 +47,7 @@ jobs: # PTVS variable group # This contains variables shared between various PTVS pipelines - - group: PTVS-Dev18 + - group: PTVS-Dev17 steps: diff --git a/azure-pipelines-integration-tests.yml b/azure-pipelines-integration-tests.yml index 7ea5842375..e4c805d11a 100644 --- a/azure-pipelines-integration-tests.yml +++ b/azure-pipelines-integration-tests.yml @@ -10,7 +10,7 @@ resources: # All PTVS build artifacts come from this pipeline and are referenced like this: # $(Pipeline.Workspace)\ComponentBuildUnderTest\\ - pipeline: ComponentBuildUnderTest - source: PTVS-Build-Dev18 + source: PTVS-Build-Dev17 branch: main # This is only used for manual/scheduled runs of this pipeline trigger: branches: diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml index 0126182ac6..1b03849847 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -28,7 +28,7 @@ variables: value: ${{ parameters.PublishNugetPackage }} # https://devdiv.visualstudio.com/DevDiv/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=604&path=PTVS-Dev18 - - group: PTVS-Dev18 + - group: PTVS-Dev17 resources: repositories: @@ -61,7 +61,7 @@ extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates parameters: pool: - name: VSEng-MicroBuildVSStable + name: VSEngSS-MicroBuild2022-1ES os: windows stages: - stage: Release diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 73880380c5..620d4da6ed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,11 +41,6 @@ parameters: type: boolean default: false -- name: buildInstaller - displayName: Build Installer & Bootstrapper - type: boolean - default: false - # build number format name: $(date:yy)$(DayOfYear)$(rev:.r) @@ -91,7 +86,7 @@ variables: - name: DropRoot value: \\cpvsbuild\Drops\DSTools\PTVS\$(Build.SourceBranchName)\$(Build.BuildNumber)\ - name: FileVersionPrefix - value: 18.0 + value: 17.0 - name: IncludeDjangoHtmlExtensions value: true - name: IncludeMiniconda @@ -124,7 +119,7 @@ variables: value: ${{ parameters.ptvsPackageVersion }} # Import variables from PTVS-Dev18 variable group - - group: PTVS-Dev18 + - group: PTVS-Dev17 # The `resources` specify the location and version of the 1ES PT. # The ref of the repository is set to release tag which is intended to be used by most pipelines. @@ -142,7 +137,7 @@ extends: # specify the image type. Here are the allowed values: windows, linux, or macOS. The default value is windows. # Hence, this property must be specified for linux and macOS. pool: - name: VSEng-MicroBuildVSStable + name: VSEngSS-MicroBuild2022-1ES os: windows featureFlags: # Consolidate SDL pre-check tasks into a single step to reduce pipeline overhead @@ -205,20 +200,27 @@ extends: displayName: 'Publish build artifact: BoM' targetPath: '$(Build.BinariesDirectory)\layout' artifactName: SBOM + - ${{ if or(notin(variables['Build.Reason'], 'PullRequest'), eq(variables['PublishNugetPackageAsBuildArtifact'], true)) }}: + - output: pipelineArtifact + displayName: 'Publish build artifact: NuGet Package' + targetPath: '$(Build.ArtifactStagingDirectory)\pkg' + artifactName: pkg steps: # check out code clean from source control - checkout: self clean: true - fetchDepth: 1 - # add VSTarget build tag - - powershell: 'Write-Host "##vso[build.addbuildtag]$env:VSTarget"' - displayName: 'Add vstarget build tag' + # Non-PR steps + - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: + + # add VSTarget build tag + - powershell: 'Write-Host "##vso[build.addbuildtag]$env:VSTarget"' + displayName: 'Add vstarget build tag' - # install microbuild plugins used for swixproj/vsmanproj, signing, and localization - - template: /Build/templates/install_microbuild_plugins.yml@self + # install microbuild plugins used for swixproj/vsmanproj, signing, and localization + - template: /Build/templates/install_microbuild_plugins.yml@self # Restore packages and install dependencies (pylance, debugpy) - template: /Build/templates/restore_packages.yml@self @@ -231,77 +233,15 @@ extends: - template: /Build/templates/build.yml@self parameters: ptvsPackageVersion: ${{ variables.ptvsPackageVersionVar }} + + # Non-PR steps + - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}: - # publish symbols - - template: /Build/templates/publish_symbols.yml@self - - # MicroBuild cleanup - - task: MicroBuildCleanup@1 - displayName: 'Execute cleanup tasks' - condition: succeededOrFailed() - - # Publish test data - - template: /Build/templates/publish_test_data.yml@self - - # Installer job: builds installer, uploads vsts drop, and creates bootstrapper - # Runs in parallel with the test job after the build job completes - - ${{ if or(ne(variables['Build.Reason'], 'PullRequest'), eq(parameters.buildInstaller, true)) }}: - - job: installer - displayName: Installer & Bootstrapper - dependsOn: build - steps: - - checkout: self - clean: true - fetchDepth: 1 - - # install microbuild plugins needed for swixproj/vsmanproj - - template: /Build/templates/install_microbuild_plugins.yml@self - - # Restore packages - - template: /Build/templates/restore_packages.yml@self - parameters: - pylanceVersion: ${{ parameters.pylanceVersion }} - pylanceReleaseType: ${{ variables.pylanceReleaseTypeVar }} - debugpyVersion: ${{ parameters.debugpyVersion }} - - # Download binaries from the build job - - download: current - artifact: Binaries - displayName: 'Download build binaries' - - # Copy binaries to expected location - - powershell: | - $source = '$(Pipeline.Workspace)\Binaries' - $dest = '$(Build.BinariesDirectory)\raw\binaries' - New-Item -ItemType Directory -Force -Path $dest | Out-Null - Copy-Item -Path "$source\*" -Destination $dest -Recurse -Force - displayName: 'Copy binaries to expected location' - - # Generate the bill of materials - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'Generate bill of materials' - inputs: - BuildDropPath: '$(Build.BinariesDirectory)\layout' - PackageName: 'PTVS' - PackageVersion: '$(VSTarget)' - continueOnError: true - - # Build the installer (product already built, only setup projects) - - task: MSBuild@1 - displayName: 'Build installer' - inputs: - solution: $(Build.SourcesDirectory)/Python/Setup/dirs.proj - msbuildVersion: $(MsBuildVersion) - platform: $(Platform) - configuration: $(BuildConfiguration) - msbuildArguments: ' /p:SkipProduct=true - /p:VSTarget=$(VSTarget) - /p:BuildNumber=${{ variables.ptvsPackageVersionVar }} - /p:BUILD_BINARIESDIRECTORY=$(Build.BinariesDirectory) - /p:BUILD_STAGINGDIRECTORY=$(Build.StagingDirectory) - /bl:$(Build.SourcesDirectory)\logs\BuildInstaller.binlog' + # Create VS bootstrapper for testing + - template: Build/templates/create_vs_bootstrapper.yml@self # Upload vsts drop used by Visual Studio insertions + # For more info, see https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs/microbuild-vsts-drop - task: 1ES.MicroBuildVstsDrop@1 displayName: 'Upload vsts drop' inputs: @@ -311,73 +251,31 @@ extends: accessToken: '$(System.AccessToken)' dropRetentionDays: 183 - # Create VS bootstrapper for testing - - template: Build/templates/create_vs_bootstrapper.yml@self - - # MicroBuild cleanup - - task: MicroBuildCleanup@1 - displayName: 'Execute cleanup tasks' - condition: succeededOrFailed() + # publish symbols + - template: /Build/templates/publish_symbols.yml@self - # Run tests on mixed mode debugger - - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['SkipGlassCache'], true)) }}: - - job: test - displayName: Test - dependsOn: build - continueOnError: true - pool: - name: VSEng-MicroBuildVSStable - steps: - - checkout: self - clean: true - fetchDepth: 1 - - - template: /Build/templates/run_tests.yml@self + # Build and publish nuget package used by VS + - template: /Build/templates/build_nuget_package.yml@self parameters: - skipGlassCache: ${{ parameters.skipGlassCache }} - - # Build, sign, and publish NuGet package - - ${{ if or(notin(variables['Build.Reason'], 'PullRequest'), eq(variables['PublishNugetPackageAsBuildArtifact'], true)) }}: - - job: nuget - displayName: NuGet Package - dependsOn: build - steps: - - checkout: self - clean: true - fetchDepth: 1 - - # install microbuild plugins needed for signing - - template: /Build/templates/install_microbuild_plugins.yml@self + ptvsPackageVersion: ${{ variables.ptvsPackageVersionVar }} - # Download binaries from the build job - - download: current - artifact: Binaries - displayName: 'Download build binaries' + # MicroBuild cleanup + - task: MicroBuildCleanup@1 + displayName: 'Execute cleanup tasks' + condition: succeededOrFailed() - # Copy binaries to expected location - - powershell: | - $source = '$(Pipeline.Workspace)\Binaries' - $dest = '$(Build.BinariesDirectory)\raw\binaries' - New-Item -ItemType Directory -Force -Path $dest | Out-Null - Copy-Item -Path "$source\*" -Destination $dest -Recurse -Force - displayName: 'Copy binaries to expected location' + # Publish test data + - template: /Build/templates/publish_test_data.yml@self - # Build, sign, and pack nuget package - - template: /Build/templates/build_nuget_package.yml@self - parameters: - ptvsPackageVersion: ${{ variables.ptvsPackageVersionVar }} + # Run tests on mixed mode debugger but only for PR builds + # - ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['SkipGlassCache'], true)) }}: + # - job: test + # displayName: Test + # steps: + # - template: /Build/templates/run_tests.yml@self + # parameters: + # skipGlassCache: ${{ parameters.skipGlassCache }} - # Publish NuGet package as build artifact - - task: 1ES.PublishBuildArtifacts@1 - displayName: 'Publish Artifact: pkg' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)\pkg' - ArtifactName: pkg - sbomEnabled: false - # MicroBuild cleanup - - task: MicroBuildCleanup@1 - displayName: 'Execute cleanup tasks' - condition: succeededOrFailed() diff --git a/test.yml b/test.yml index aebda15033..838fd96f42 100644 --- a/test.yml +++ b/test.yml @@ -13,10 +13,10 @@ pr: none pool: - name: VSEng-MicroBuildVSStable + name: VSEngSS-MicroBuild2022-1ES demands: - msbuild - - VisualStudio_18.0 + - VisualStudio_17.0 variables: ORGANIZATION: 'DevDiv'