[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.
This commit is contained in:
Manuel de la Pena 2023-02-21 14:06:13 -05:00 коммит произвёл GitHub
Родитель d30cc612ce
Коммит 4e640a9f40
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 94 добавлений и 89 удалений

Просмотреть файл

@ -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'

Просмотреть файл

@ -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)"