Skip to content

Commit

Permalink
Hardcode manifest name when building source-only (#45554)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorHofer authored Dec 19, 2024
1 parent 4a7aa40 commit 11df5a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
22 changes: 12 additions & 10 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ jobs:
sbomEnabled: true

# Using build artifacts to enable publishing the vertical manifests to a single artifact from different jobs
- output: buildArtifacts
PathtoPublish: $(artifactsStagingDir)/manifests/${{ parameters.configuration }}/$(Agent.JobName).xml
ArtifactName: VerticalManifests
displayName: Publish Vertical Manifest
sbomEnabled: false
- ${{ if ne(parameters.buildSourceOnly, true) }}:
- output: buildArtifacts
PathtoPublish: $(artifactsStagingDir)/manifests/${{ parameters.configuration }}/$(Agent.JobName).xml
ArtifactName: VerticalManifests
displayName: Publish Vertical Manifest
sbomEnabled: false

steps:
- ${{ if not(parameters.isBuiltFromVmr) }}:
Expand Down Expand Up @@ -578,8 +579,9 @@ jobs:
continueOnError: true

# Using build artifacts to enable publishing the vertical manifests to a single artifact from different jobs
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(artifactsStagingDir)/manifests/${{ parameters.configuration }}/$(Agent.JobName).xml
ArtifactName: VerticalManifests
displayName: Publish Vertical Manifest
- ${{ if ne(parameters.buildSourceOnly, true) }}:
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(artifactsStagingDir)/manifests/${{ parameters.configuration }}/$(Agent.JobName).xml
ArtifactName: VerticalManifests
displayName: Publish Vertical Manifest
8 changes: 6 additions & 2 deletions src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,12 @@
</PropertyGroup>

<PropertyGroup>
<!-- Respect the VerticalName property which is set to a unique identifier in CI. Otherwise default to 'VerticalManifest'. -->
<MergedAssetManifestOutputPath>$(ArtifactsAssetManifestsDir)$([MSBuild]::ValueOrDefault('$(VerticalName)', 'VerticalManifest')).xml</MergedAssetManifestOutputPath>
<!-- Respect the VerticalName property which is set to a unique identifier in CI.
Don't use that when building source-only to allow the build to find the previously built manifest file regardless of the vertical name.
Default to VerticalManifest.xml. -->
<MergedAssetManifestName Condition="'$(VerticalName)' != ''">$(VerticalName).xml</MergedAssetManifestName>
<MergedAssetManifestName Condition="'$(DotNetBuildSourceOnly)' == 'true' or '$(MergedAssetManifestName)' == ''">VerticalManifest.xml</MergedAssetManifestName>
<MergedAssetManifestOutputPath>$(ArtifactsAssetManifestsDir)$(MergedAssetManifestName)</MergedAssetManifestOutputPath>
</PropertyGroup>

</Project>

0 comments on commit 11df5a7

Please sign in to comment.