From 4e640a9f4099131440d8bb9781a1d68565ef318b Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Tue, 21 Feb 2023 14:06:13 -0500 Subject: [PATCH] [CI] Do not skip the insertion but the nuget push. (#17571) Do not skip the msi conversion since that will be needed in the unified pipeline BUT skip pushing to the internal nuget feeds. --- .../automation/templates/main-stage.yml | 30 ++-- .../templates/release/vs-insertion-prep.yml | 153 +++++++++--------- 2 files changed, 94 insertions(+), 89 deletions(-) diff --git a/tools/devops/automation/templates/main-stage.yml b/tools/devops/automation/templates/main-stage.yml index 23135555c0..dfad486ab1 100644 --- a/tools/devops/automation/templates/main-stage.yml +++ b/tools/devops/automation/templates/main-stage.yml @@ -52,9 +52,9 @@ parameters: type: boolean default: false # only to be used when testing the CI and we do not need a signed pkg -- name: skipInsertion +- name: pushNugets type: boolean - default: false # just to be skipped by the unified pipeline. + default: true # default to true until otherwhise - name: isPR type: boolean @@ -259,19 +259,19 @@ stages: repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} -- ${{ if eq(parameters.skipInsertion, false) }}: - # .NET Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc - # setting the stage at this level makes the graph of the UI look better, else the lines overlap and is not clear. - # Got to disable the lint check because azp yaml template engine does not allow use to do a multiline if :/ - # yamllint disable-line rule: line-length - - ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release-test/'), eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'), eq(variables['Build.SourceBranch'], 'refs/heads/net8.0'), eq(parameters.forceInsertion, true))) }}: - - template: ./release/vs-insertion-prep.yml - parameters: - dependsOn: - - sign_notarize_dotnet - isPR: ${{ parameters.isPR }} - repositoryAlias: ${{ parameters.repositoryAlias }} - commit: ${{ parameters.commit }} +# .NET Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc +# setting the stage at this level makes the graph of the UI look better, else the lines overlap and is not clear. +# Got to disable the lint check because azp yaml template engine does not allow use to do a multiline if :/ +# yamllint disable-line rule: line-length +- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release-test/'), eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'), eq(variables['Build.SourceBranch'], 'refs/heads/net8.0'), eq(parameters.forceInsertion, true))) }}: + - template: ./release/vs-insertion-prep.yml + parameters: + dependsOn: + - sign_notarize_dotnet + isPR: ${{ parameters.isPR }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} + pushNugets: ${{ parameters.commit }} - stage: funnel displayName: '${{ parameters.stageDisplayNamePrefix }}Collect signed artifacts' diff --git a/tools/devops/automation/templates/release/vs-insertion-prep.yml b/tools/devops/automation/templates/release/vs-insertion-prep.yml index 2318eba40d..e262543f57 100644 --- a/tools/devops/automation/templates/release/vs-insertion-prep.yml +++ b/tools/devops/automation/templates/release/vs-insertion-prep.yml @@ -18,6 +18,10 @@ parameters: type: string default: HEAD +- name: pushNugets + type: boolean + default: true + stages: - stage: prepare_release displayName: Prepare Release @@ -42,87 +46,88 @@ stages: signType: Real useDateTimeVersion: true - # Check - "xamarin-macios (Prepare Release Push NuGets)" - - job: push_signed_nugets - displayName: Push NuGets - dependsOn: nuget_convert - variables: - skipNugetSecurityAnalysis: true - pool: - vmImage: windows-latest - steps: - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: nuget-signed - downloadPath: $(Build.SourcesDirectory)/package - patterns: | - *.nupkg + - ${{ if eq(parameters.pushNugets, true) }}: + # Check - "xamarin-macios (Prepare Release Push NuGets)" + - job: push_signed_nugets + displayName: Push NuGets + dependsOn: nuget_convert + variables: + skipNugetSecurityAnalysis: true + pool: + vmImage: windows-latest + steps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: nuget-signed + downloadPath: $(Build.SourcesDirectory)/package + patterns: | + *.nupkg - - task: NuGetCommand@2 - displayName: Publish Nugets to dotnet7 - inputs: - command: push - packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg - nuGetFeedType: external - publishFeedCredentials: dnceng-dotnet7 + - task: NuGetCommand@2 + displayName: Publish Nugets to dotnet7 + inputs: + command: push + packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg + nuGetFeedType: external + publishFeedCredentials: dnceng-dotnet7 - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vs-msi-nugets - downloadPath: $(Build.SourcesDirectory)/vs-msi-nugets - patterns: | - *.nupkg + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vs-msi-nugets + downloadPath: $(Build.SourcesDirectory)/vs-msi-nugets + patterns: | + *.nupkg - - task: NuGetCommand@2 - displayName: Publish VS MSI Nugets to dotnet7 - inputs: - command: push - packagesToPush: $(Build.SourcesDirectory)/vs-msi-nugets/*.nupkg - nuGetFeedType: external - publishFeedCredentials: dnceng-dotnet7 + - task: NuGetCommand@2 + displayName: Publish VS MSI Nugets to dotnet7 + inputs: + command: push + packagesToPush: $(Build.SourcesDirectory)/vs-msi-nugets/*.nupkg + nuGetFeedType: external + publishFeedCredentials: dnceng-dotnet7 - - pwsh: | - mkdir $(Build.SourcesDirectory)/nugets-blob - cp $(Build.SourcesDirectory)/package/* $(Build.SourcesDirectory)/nugets-blob - cp $(Build.SourcesDirectory)/vs-msi-nugets/* $(Build.SourcesDirectory)/nugets-blob - displayName: "Copy content for the nugets blob." + - pwsh: | + mkdir $(Build.SourcesDirectory)/nugets-blob + cp $(Build.SourcesDirectory)/package/* $(Build.SourcesDirectory)/nugets-blob + cp $(Build.SourcesDirectory)/vs-msi-nugets/* $(Build.SourcesDirectory)/nugets-blob + displayName: "Copy content for the nugets blob." - - template: templates/common/upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - yamlResourceName: yaml-templates - githubToken: $(GitHub.Token) - githubContext: $(NupkgCommitStatusName) - blobName: $(NupkgCommitStatusName) - packagePrefix: xamarin-macios - artifactsPath: $(Build.SourcesDirectory)/nugets-blob + - template: templates/common/upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + yamlResourceName: yaml-templates + githubToken: $(GitHub.Token) + githubContext: $(NupkgCommitStatusName) + blobName: $(NupkgCommitStatusName) + packagePrefix: xamarin-macios + artifactsPath: $(Build.SourcesDirectory)/nugets-blob - - template: templates/common/upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - yamlResourceName: yaml-templates - githubToken: $(GitHub.Token) - githubContext: $(VSDropCommitStatusName) - blobName: $(VSDropCommitStatusName) - packagePrefix: xamarin-macios - artifactsPath: $(Build.SourcesDirectory)/vs-insertion - downloadSteps: - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vsdrop-signed - downloadPath: $(Build.SourcesDirectory)/vs-insertion + - template: templates/common/upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + yamlResourceName: yaml-templates + githubToken: $(GitHub.Token) + githubContext: $(VSDropCommitStatusName) + blobName: $(VSDropCommitStatusName) + packagePrefix: xamarin-macios + artifactsPath: $(Build.SourcesDirectory)/vs-insertion + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-signed + downloadPath: $(Build.SourcesDirectory)/vs-insertion - - template: templates/common/upload-vs-insertion-artifacts.yml@sdk-insertions - parameters: - yamlResourceName: yaml-templates - githubToken: $(GitHub.Token) - githubContext: $(MultiTargetVSDropCommitStatusName) - blobName: $(MultiTargetVSDropCommitStatusName) - packagePrefix: xamarin-macios - artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) - downloadSteps: - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: vsdrop-multitarget-signed - downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) + - template: templates/common/upload-vs-insertion-artifacts.yml@sdk-insertions + parameters: + yamlResourceName: yaml-templates + githubToken: $(GitHub.Token) + githubContext: $(MultiTargetVSDropCommitStatusName) + blobName: $(MultiTargetVSDropCommitStatusName) + packagePrefix: xamarin-macios + artifactsPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) + downloadSteps: + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: vsdrop-multitarget-signed + downloadPath: $(Build.StagingDirectory)\$(MultiTargetVSDropCommitStatusName) # Check - "xamarin-macios (VS Insertion Wait For Approval)" # Check - "xamarin-macios (VS Insertion Create VS Drop and Open PR)"