@@ -55,7 +55,7 @@ extends:
5555 isCustom : true
5656 name : ${{ configuration.agentPool }}
5757 variables :
58- ob_artifactBaseName : $(toolchainArtifactNameBase)_${{ configuration.name }}
58+ ob_artifactBaseName : $(toolchainArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
5959 ob_outputDirectory : $(Build.ArtifactStagingDirectory)
6060 steps :
6161 - template : .pipelines/templates/RawToolchainDownload.yml@self
@@ -72,13 +72,17 @@ extends:
7272 # and make it available to the next stage via an output variable: 'CalculateToolchainPackageRetestList.toolchainPackageRetestList'
7373 - template : .pipelines/templates/ToolchainCalculatePackageRetests.yml@self
7474
75+ - script : echo "##vso[task.setvariable variable=toolchainArtifactName;isOutput=true]$(ob_artifactBaseName)"
76+ name : " ToolchainArtifactName"
77+ displayName : " Set variable for published artifact name"
78+
7579 # 1. Automatic publishing won't work if 'isCustom: true' is set on the pool. We cannot do 'isCustom: false' because
7680 # then OneBranch attempts to perform additional actions (adding build tags for instance), which require additional permissions
7781 # that the PR check pipeline does not have.
7882 # 2. The value for 'artifact' must equal $(ob_artifactBaseName), as this is the only value OneBranch accepts.
7983 - task : PublishPipelineArtifact@1
8084 inputs :
81- artifact : $(toolchainArtifactNameBase)_${{ configuration.name }}
85+ artifact : $(toolchainArtifactNameBase)_${{ configuration.name }}_$(System.JobAttempt)
8286 targetPath : $(ob_outputDirectory)
8387 condition : always()
8488 displayName : " Publish toolchain artifacts"
@@ -92,25 +96,31 @@ extends:
9296 isCustom : true
9397 name : ${{ configuration.agentPool }}
9498 variables :
95- ob_artifactBaseName : ${{ variables.rpmsArtifactNameBase }}_${{ configuration.name }}
99+ ob_artifactBaseName : ${{ variables.rpmsArtifactNameBase }}_${{ configuration.name }}_$(System.JobAttempt)
96100 ob_outputDirectory : $(Build.ArtifactStagingDirectory)
97101 testListFromToolchain : $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['CalculateToolchainPackageRetestList.toolchainPackageRetestList'] ]
102+ toolchainArtifactName : $[ stageDependencies.Toolchain_${{ configuration.name }}.Build.outputs['ToolchainArtifactName.toolchainArtifactName'] ]
98103 steps :
99104 - template : .pipelines/templates/PackageBuild.yml@self
100105 parameters :
101- customToolchainArtifactName : $(toolchainArtifactNameBase)_${{ configuration.name }}
106+ customToolchainArtifactName : $(toolchainArtifactName)
102107 isCheckBuild : true
103108 isQuickRebuildPackages : true
109+ isUseCCache : true
104110 outputArtifactsFolder : $(ob_outputDirectory)
105111 maxCPU : " ${{ configuration.maxCPUs }}"
106112 pipArtifactFeeds : " mariner/Mariner-Pypi-Feed"
107113 selfRepoName : self
108114 testSuiteName : " [${{ configuration.name }}] Package test"
109115 testRerunList : " $(testListFromToolchain)"
110116
117+ - script : echo "##vso[task.setvariable variable=rpmsArtifactName;isOutput=true]$(ob_artifactBaseName)"
118+ name : " RPMsArtifactName"
119+ displayName : " Set variable for published artifact name"
120+
111121 - task : PublishPipelineArtifact@1
112122 inputs :
113- artifact : ${{ variables.rpmsArtifactNameBase }}_${{ configuration.name }}
123+ artifact : ${{ variables.rpmsArtifactNameBase }}_${{ configuration.name }}_$(System.JobAttempt)
114124 targetPath : $(ob_outputDirectory)
115125 condition : always()
116126 displayName : " Publish packages build artifacts"
@@ -123,7 +133,9 @@ extends:
123133 type : linux
124134 isCustom : true
125135 name : ${{ configuration.agentPool }}
136+ variables :
137+ rpmsArtifactName : $[ stageDependencies.RPMs_${{ configuration.name }}.BuildAndTest.outputs['RPMsArtifactName.rpmsArtifactName'] ]
126138 steps :
127139 - template : .pipelines/templatesWithCheckout/SodiffCheck.yml@self
128140 parameters :
129- inputArtifactName : ${{ variables.rpmsArtifactNameBase }}_${{ configuration.name }}
141+ inputArtifactName : $(rpmsArtifactName)
0 commit comments