diff --git a/azure-pipelines/vs-insertion-experimental.yml b/azure-pipelines/vs-insertion-experimental.yml index d74aad34d5f..6a1a2d6249f 100644 --- a/azure-pipelines/vs-insertion-experimental.yml +++ b/azure-pipelines/vs-insertion-experimental.yml @@ -1,13 +1,5 @@ trigger: none name: $(Date:yyyyMMdd).$(Rev:r) MSBuild Experimental VS Insertion -variables: - InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion) - InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1 - InsertDescription: Insert MSBuild $(Build.BuildNumber) from the branch $(Build.SourceBranchName) at commit $(Build.SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion) - InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.Build.Number);Microsoft.Build.UnGAC.vsman - InsertPayloadName: MSBuild $(Build.SourceBranchName) $(Build.BuildNumber) - TeamName: msbuild - TeamEmail: msbuild@microsoft.com resources: pipelines: - pipeline: 'MSBuild' @@ -28,10 +20,18 @@ extends: pool: name: VSEngSS-MicroBuild2022-1ES customBuildTags: - - ES365AIMigrationTooling-Release + - Experimental stages: - stage: Stage_1 displayName: Create VS PR + variables: + InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion) + InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1 + InsertDescription: Insert MSBuild $(resources.pipeline.MSBuild.runName) from the branch $(resources.pipeline.MSBuild.sourceBranch) at commit $(resources.pipeline.MSBuild.sourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion) + InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(resources.pipeline.MSBuild.sourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(resources.pipeline.MSBuild.sourceBranch)/$(resources.pipeline.MSBuild.runName);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(resources.pipeline.MSBuild.sourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(resources.pipeline.MSBuild.sourceBranch)/$(resources.pipeline.MSBuild.runName);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(resources.pipeline.MSBuild.sourceBranch)/$(resources.pipeline.MSBuild.runName);Microsoft.Build.UnGAC.vsman + InsertPayloadName: MSBuild $(resources.pipeline.MSBuild.sourceBranch) $(MSBuild_ExtApisPackageVersion) + TeamName: msbuild + TeamEmail: msbuild@microsoft.com jobs: - job: Job_1 displayName: Run on agent @@ -39,14 +39,6 @@ extends: timeoutInMinutes: 0 templateContext: inputs: - - input: pipelineArtifact - pipeline: 'MSBuild' - artifactName: 'BuildLogs_SourceBuild_Managed_Attempt1' - targetPath: '$(Pipeline.Workspace)/BuildLogs_SourceBuild_Managed_Attempt1' - - input: pipelineArtifact - pipeline: 'MSBuild' - artifactName: 'build_Windows_NT_SBOM' - targetPath: '$(Pipeline.Workspace)/build_Windows_NT_SBOM' - input: pipelineArtifact pipeline: 'MSBuild' artifactName: 'xsd' @@ -56,6 +48,14 @@ extends: artifactName: 'PackageArtifacts' targetPath: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' steps: + - task: Powershell@2 + name: RemoveSourceBuildPackage + displayName: Remove sourcebuild package + inputs: + targetType: inline + script: | + $folder = "$(Build.ArtifactStagingDirectory)/PackageArtifacts" + Get-ChildItem -Path $folder -Filter 'Microsoft.SourceBuild.Intermediate*.nupkg' | Remove-Item -Force - task: Powershell@2 name: Powershell_1 displayName: Munge ExternalAPIs package version diff --git a/azure-pipelines/vs-insertion.yml b/azure-pipelines/vs-insertion.yml index a7fafc8da41..086f22dab22 100644 --- a/azure-pipelines/vs-insertion.yml +++ b/azure-pipelines/vs-insertion.yml @@ -2,6 +2,17 @@ trigger: none name: $(Date:yyyyMMdd).$(Rev:r) +resources: + pipelines: + - pipeline: 'MSBuild' + project: 'DevDiv' + source: 'MSBuild' + repositories: + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/release + schedules: - cron: '0 3 * * *' # Runs every day at 3AM UTC displayName: Daily VS insertion @@ -27,6 +38,15 @@ parameters: - rel/d17.6 - rel/d17.3 - rel/d17.0 + - name: DropRetentionDays + default: 183 + type: number + displayName: 'Drop Retention Days (do not set to < 90)' + - name: SourceBranchNameParam + default: auto + type: string + displayName: 'Source Branch Name (recommended to use `auto`)' + variables: # `auto` should work every time and selecting a branch in parameters is likely to fail due to incompatible versions in MSBuild and VS - name: AutoInsertTargetBranch @@ -65,17 +85,16 @@ variables: value: msbuild - name: TeamEmail value: msbuild@microsoft.com + - name: MSBuild_CI_BuildNumber + value: $(resources.pipeline.MSBuild.runName) + - name: MSBuild_CI_SourceVersion + value: $(resources.pipeline.MSBuild.sourceCommit) + - name: SourceBranchName + ${{ if not(eq(parameters.SourceBranchNameParam, 'auto')) }}: + value: ${{ parameters.SourceBranchNameParam }} + ${{ else }}: + value: $(Build.SourceBranchName) -resources: - pipelines: - - pipeline: 'MSBuild' - project: 'DevDiv' - source: 'MSBuild' - repositories: - - repository: 1ESPipelineTemplates - type: git - name: 1ESPipelineTemplates/1ESPipelineTemplates - ref: refs/tags/release extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates parameters: @@ -106,26 +125,19 @@ extends: name: MicroBuildRetainVstsDrops_2 displayName: Retain VSTS Drops inputs: - DropNames: Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber) + DropNames: Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber) AccessToken: $(System.AccessToken) DropServiceUri: https://devdiv.artifacts.visualstudio.com/DefaultCollection - # retain servicing indefinitely, main only for 183 days - ${{ if eq(variables['InsertTargetBranch'], 'main') }}: - DropRetentionDays: 183 + DropRetentionDays: ${{ parameters.DropRetentionDays }} - stage: VSInsertion displayName: VS insertion dependsOn: RetainBuild variables: InsertConfigValues: VS.ExternalAPIs.MSBuild=$(MSBuild_ExtApisPackageVersion) InsertCustomScriptExecutionCommand: $(Pipeline.Workspace)\xsd\Update-MSBuildXsds.ps1 - InsertDescription: Insert MSBuild $(Build.BuildNumber) from the branch $(Build.SourceBranchName) at commit $(Build.SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion) - InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(Build.SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(Build.SourceBranchName)/$(Build.BuildNumber);Microsoft.Build.UnGAC.vsman - InsertPayloadName: MSBuild $(Build.SourceBranchName) $(Build.BuildNumber) - SymbolsAgentPath: $(Pipeline.Workspace)\$(Build.DefinitionName)\Symbols - SymbolsEmailContacts: raines - SymbolsFeatureName: MSBuild - SymbolsSymwebProject: DDE - SymbolsUncPath: '\\cpvsbuild\drops\MSBuild\symbols\$(Build.DefinitionName)\$(Build.BuildNumber)\symbols.archive' + InsertDescription: Insert MSBuild $(MSBuild_CI_BuildNumber) from the branch $(SourceBranchName) at commit $(MSBuild_CI_SourceVersion). Corresponding package version is $(MSBuild_ExtApisPackageVersion) + InsertJsonValues: Microsoft.Build.vsman{$(MSBuild_ExtApisPackageVersion)+$(MSBuild_CI_SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber);Microsoft.Build.vsman,Microsoft.Build.Arm64.vsman{$(MSBuild_ExtApisPackageVersion)+$(MSBuild_CI_SourceVersion)}=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber);Microsoft.Build.Arm64.vsman,Microsoft.Build.UnGAC.vsman=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/DotNet-msbuild-Trusted/$(SourceBranchName)/$(MSBuild_CI_BuildNumber);Microsoft.Build.UnGAC.vsman + InsertPayloadName: MSBuild $(SourceBranchName) $(MSBuild_ExtApisPackageVersion) jobs: - job: PushPackages displayName: Push Packages @@ -133,14 +145,6 @@ extends: timeoutInMinutes: 0 templateContext: inputs: - - input: pipelineArtifact - pipeline: 'MSBuild' - artifactName: 'BuildLogs_SourceBuild_Managed_Attempt1' - targetPath: '$(Pipeline.Workspace)/BuildLogs_SourceBuild_Managed_Attempt1' - - input: pipelineArtifact - pipeline: 'MSBuild' - artifactName: 'build_Windows_NT_SBOM' - targetPath: '$(Pipeline.Workspace)/build_Windows_NT_SBOM' - input: pipelineArtifact pipeline: 'MSBuild' artifactName: 'xsd' @@ -150,6 +154,14 @@ extends: artifactName: 'PackageArtifacts' targetPath: '$(Build.ArtifactStagingDirectory)/PackageArtifacts' steps: + - task: Powershell@2 + name: RemoveSourceBuildPackage + displayName: Remove sourcebuild package + inputs: + targetType: inline + script: | + $folder = "$(Build.ArtifactStagingDirectory)/PackageArtifacts" + Get-ChildItem -Path $folder -Filter 'Microsoft.SourceBuild.Intermediate*.nupkg' | Remove-Item -Force - task: Powershell@2 name: PwshMungeExternalAPIsPkgVersion displayName: Munge ExternalAPIs package version