Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Build/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
21 changes: 9 additions & 12 deletions Build/templates/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -47,7 +47,7 @@ jobs:

# PTVS variable group
# This contains variables shared between various PTVS pipelines
- group: PTVS-Dev18
- group: PTVS-Dev17

steps:

Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resources:
# All PTVS build artifacts come from this pipeline and are referenced like this:
# $(Pipeline.Workspace)\ComponentBuildUnderTest\<artifactName>\<filePath>
- 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:
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
184 changes: 41 additions & 143 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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()


4 changes: 2 additions & 2 deletions test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down