From 4be094f3d090a3ecf31340ee9a4a711f4afa6330 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Mon, 26 Feb 2024 15:03:38 -0800 Subject: [PATCH] Add OneESPT flags to toggle between different publish --- eng/pipelines/steps/BuildSolution.yml | 3 +++ .../steps/CollectAndPublishBinaries.yml | 2 ++ eng/pipelines/steps/CopyAndPublishSymbols.yml | 4 ++++ .../steps/PackAndPublishVSPackages.yml | 1 + eng/pipelines/steps/PublishOpenDebugAD7.yml | 2 ++ .../tasks/1ES/PublishPipelineArtifact.yml | 21 +++++++++++++------ eng/pipelines/templates/Build.template.yml | 2 ++ .../templates/VS-release.template.yml | 4 ++++ .../VSCode-codesign-osx.template.yml | 1 + .../VSCode-esrp-sign-osx.template.yml | 1 + .../templates/VSCode-release.template.yml | 4 ++++ 11 files changed, 39 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/steps/BuildSolution.yml b/eng/pipelines/steps/BuildSolution.yml index 68758f48a..4e6c39263 100644 --- a/eng/pipelines/steps/BuildSolution.yml +++ b/eng/pipelines/steps/BuildSolution.yml @@ -4,6 +4,7 @@ parameters: Solution: '$(Build.SourcesDirectory)\src\MIDebugEngine.sln' Configuration: 'Release' BuildArguments: '' + OneESPT: false steps: - template: ../tasks/NuGetCommand.yml @@ -37,6 +38,7 @@ steps: targetPath: '$(Build.BinariesDirectory)/build_logs/' artifactName: '${{ parameters.Configuration }}_binlog' condition: ne(variables['System.Debug'], '') + OneESPT: ${{ parameters.OneESPT }} - template: ../tasks/1ES/PublishPipelineArtifact.yml parameters: @@ -44,4 +46,5 @@ steps: targetPath: '$(Build.SourcesDirectory)\bin\${{ parameters.Configuration }}' artifactName: '${{ parameters.Configuration }}_debug_bin' condition: ne(variables['System.Debug'], '') + OneESPT: ${{ parameters.OneESPT }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/CollectAndPublishBinaries.yml b/eng/pipelines/steps/CollectAndPublishBinaries.yml index 092bb36c8..3cbb6ac78 100644 --- a/eng/pipelines/steps/CollectAndPublishBinaries.yml +++ b/eng/pipelines/steps/CollectAndPublishBinaries.yml @@ -3,6 +3,7 @@ parameters: TargetFolder: '$(Build.SourcesDirectory)\drop' ArtifactName: 'drop' + OneESPT: false steps: - template: ../tasks/CopyFiles.yml @@ -18,4 +19,5 @@ steps: displayName: 'Publish Binaries' targetPath: ${{ parameters.TargetFolder }} artifactName: '${{ parameters.ArtifactName }}' + OneESPT: ${{ parameters.OneESPT }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/CopyAndPublishSymbols.yml b/eng/pipelines/steps/CopyAndPublishSymbols.yml index 3d50fd18a..b61728414 100644 --- a/eng/pipelines/steps/CopyAndPublishSymbols.yml +++ b/eng/pipelines/steps/CopyAndPublishSymbols.yml @@ -1,5 +1,8 @@ # Collects build symbols and publishes them as 'Symbols' --- +parameters: + OneESPT: false + steps: - template: ../tasks/CopyFiles.yml parameters: @@ -32,4 +35,5 @@ steps: displayName: 'Publish Symbols' targetPath: '$(Build.ArtifactStagingDirectory)/symbols' artifactName: 'Symbols' + OneESPT: ${{ parameters.OneESPT }} ... \ No newline at end of file diff --git a/eng/pipelines/steps/PackAndPublishVSPackages.yml b/eng/pipelines/steps/PackAndPublishVSPackages.yml index 365ce5529..fd95d189e 100644 --- a/eng/pipelines/steps/PackAndPublishVSPackages.yml +++ b/eng/pipelines/steps/PackAndPublishVSPackages.yml @@ -17,6 +17,7 @@ steps: displayName: 'Publish File Version' targetPath: '$(Build.SourcesDirectory)\obj\Lab.Release\NugetPackageVersion.txt' artifactName: 'PackageVersion' + OneESPT: true - template: ../tasks/NuGetCommand.yml parameters: diff --git a/eng/pipelines/steps/PublishOpenDebugAD7.yml b/eng/pipelines/steps/PublishOpenDebugAD7.yml index 9fd5fde92..094cbf4d5 100644 --- a/eng/pipelines/steps/PublishOpenDebugAD7.yml +++ b/eng/pipelines/steps/PublishOpenDebugAD7.yml @@ -44,6 +44,7 @@ steps: displayName: 'Publish Unsigned ${{ parameters.RuntimeID }}' targetPath: '$(Build.StagingDirectory)\${{ parameters.RuntimeID }}' artifactName: 'unsigned_${{ parameters.RuntimeID }}_binaries' + OneESPT: true # Publishing for non-macOS - ${{ if not(startsWith(parameters.RuntimeID, 'osx-')) }}: @@ -56,3 +57,4 @@ steps: displayName: 'Publish ${{ parameters.RuntimeID }}' targetPath: '$(Build.StagingDirectory)\zips\${{ parameters.RuntimeID }}.zip' artifactName: '${{ parameters.RuntimeID }}_zip' + OneESPT: true diff --git a/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml b/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml index 9feac58e4..065c933ea 100644 --- a/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml +++ b/eng/pipelines/tasks/1ES/PublishPipelineArtifact.yml @@ -4,12 +4,21 @@ parameters: targetPath: '$(Build.ArtifactStagingDirectory)' artifactName: 'drop' condition: 'succeeded()' + OneESPT: false # Indicates that this is running under the 1ES Pipeline Template steps: -- task: 1ES.PublishPipelineArtifact@1 - displayName: ${{ parameters.displayName }} - inputs: - targetPath: ${{ parameters.targetPath }} - artifactName: '${{ parameters.artifactName }}' - condition: ${{ parameters.condition }} +- ${{ if eq(parameters['OneESPT'], true) }}: + - task: 1ES.PublishPipelineArtifact@1 + displayName: ${{ parameters.displayName }} + inputs: + targetPath: ${{ parameters.targetPath }} + artifactName: '${{ parameters.artifactName }}' + condition: ${{ parameters.condition }} +- ${{ else }}: + - template: ../PublishPipelineArtifact.yml + parameters: + path: '${{ parameters.targetPath }}' + artifactName: '${{ parameters.artifactName }}' + displayName: ${{ parameters.displayName }} + condition: ${{ parameters.condition }} ... \ No newline at end of file diff --git a/eng/pipelines/templates/Build.template.yml b/eng/pipelines/templates/Build.template.yml index 502ddf823..f26c81aca 100644 --- a/eng/pipelines/templates/Build.template.yml +++ b/eng/pipelines/templates/Build.template.yml @@ -18,6 +18,7 @@ steps: - template: ../steps/BuildSolution.yml parameters: Configuration: ${{ parameters.Configuration }} + OneESPT: false - template: ../tasks/CSharp.yml @@ -26,6 +27,7 @@ steps: parameters: TargetFolder: '$(Build.StagingDirectory)\drop' ArtifactName: '${{ parameters.Configuration }}' + OneESPT: false - template: ../tasks/MicroBuildCleanup.yml ... \ No newline at end of file diff --git a/eng/pipelines/templates/VS-release.template.yml b/eng/pipelines/templates/VS-release.template.yml index e9408071e..352fa49ae 100644 --- a/eng/pipelines/templates/VS-release.template.yml +++ b/eng/pipelines/templates/VS-release.template.yml @@ -9,17 +9,21 @@ steps: - template: ../steps/BuildSolution.yml parameters: Configuration: 'Lab.Release' + OneESPT: true - template: ../steps/CollectAndPublishBinaries.yml parameters: TargetFolder: '$(Build.StagingDirectory)\drop' ArtifactName: 'drop' + OneESPT: true - template: ../tasks/SignVerify.yml parameters: TargetFolders: '$(Build.StagingDirectory)\drop' - template: ../steps/CopyAndPublishSymbols.yml + parameters: + OneESPT: true - template: ../steps/PackAndPublishVSPackages.yml parameters: diff --git a/eng/pipelines/templates/VSCode-codesign-osx.template.yml b/eng/pipelines/templates/VSCode-codesign-osx.template.yml index 42033534c..6ef2efc4d 100644 --- a/eng/pipelines/templates/VSCode-codesign-osx.template.yml +++ b/eng/pipelines/templates/VSCode-codesign-osx.template.yml @@ -27,4 +27,5 @@ steps: displayName: 'Publish Binaries' targetPath: '$(Pipeline.Workspace)/${{ rid }}.zip' artifactName: 'unsigned_${{ rid }}_zip' + OneESPT: true ... diff --git a/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml b/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml index d1822636e..f8efc334f 100644 --- a/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml +++ b/eng/pipelines/templates/VSCode-esrp-sign-osx.template.yml @@ -23,4 +23,5 @@ steps: displayName: 'Publish Binaries' targetPath: '$(Pipeline.Workspace)\Artifacts\${{ rid }}.zip' artifactName: '${{ rid }}_zip' + OneESPT: true ... \ No newline at end of file diff --git a/eng/pipelines/templates/VSCode-release.template.yml b/eng/pipelines/templates/VSCode-release.template.yml index af2638c3f..061e08130 100644 --- a/eng/pipelines/templates/VSCode-release.template.yml +++ b/eng/pipelines/templates/VSCode-release.template.yml @@ -13,11 +13,13 @@ steps: - template: ../steps/BuildSolution.yml parameters: Configuration: 'Lab.Release' + OneESPT: true - template: ../steps/CollectAndPublishBinaries.yml parameters: TargetFolder: '$(Build.StagingDirectory)\bin' ArtifactName: 'bin' + OneESPT: true - template: ../tasks/SignVerify.yml parameters: @@ -25,6 +27,8 @@ steps: ExcludeFolders: '.git MicroBuild' - template: ../steps/CopyAndPublishSymbols.yml + parameters: + OneESPT: true - script: | mkdir $(Build.StagingDirectory)\zips\