Skip to content

Simplify Publishing.props #54566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ stages:
/p:AssetManifestFileName=aspnetcore-win.xml
$(_BuildArgs)
$(_PublishArgs)
/p:PublishInstallerBaseVersion=true
$(_InternalRuntimeDownloadArgs)
$(WindowsArm64InstallersLogArgs)
displayName: Build ARM64 Installers
Expand Down
80 changes: 37 additions & 43 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
<Project>
<PropertyGroup>
<PublishingVersion>3</PublishingVersion>
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
</PropertyGroup>

<PropertyGroup>
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksumsAndProductVersion</PublishDependsOnTargets>

<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
<_UploadPathRoot>aspnetcore</_UploadPathRoot>
<ProductVersionFileName>productVersion.txt</ProductVersionFileName>
<RepoProductVersionFileName>$(_UploadPathRoot)-$(ProductVersionFileName)</RepoProductVersionFileName>
<ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation>
<RepoProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(RepoProductVersionFileName)</RepoProductVersionFileLocation>

<!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
to be published. Use DotNetBuildRepo is only set in the internal source build,
and Build.proj is invoked from the wrapper build. -->
<EnableDefaultPublishItems Condition="'$(OS)' != 'Windows_NT' and
'$(PostBuildSign)' != 'true' and
'$(DotNetBuildRepo)' != 'true'">false</EnableDefaultPublishItems>

<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == '' and '$(EnableDefaultPublishItems)' == 'true'">true</PublishInstallerBaseVersion>
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
</PropertyGroup>

<!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
Expand All @@ -31,8 +39,7 @@
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.msi" UploadPathSegment="Runtime" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.rpm" UploadPathSegment="Runtime" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.tar.gz" UploadPathSegment="Runtime" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.version" UploadPathSegment="Runtime"
Condition=" '$(PublishInstallerBaseVersion)' == 'true' or '$(DotNetBuildRepo)' == 'true'" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.version" UploadPathSegment="Runtime" Condition="'$(PublishInstallerBaseVersion)' == 'true'" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.wixlib" UploadPathSegment="Runtime" />
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.zip" UploadPathSegment="Runtime" />
<!-- Remove wixpacks if not doing post-build signing, since they are not needed -->
Expand All @@ -42,7 +49,8 @@

<Target
Name="_PublishInstallersAndChecksumsAndProductVersion"
DependsOnTargets="_WriteProductVersionFile">
DependsOnTargets="_WriteProductVersionFile"
BeforeTargets="PublishToAzureDevOpsArtifacts">
<!--
This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
and npm project. We use Microsoft.AspNetCore.InternalTesting.csproj because it is non-shipping (we need a non-stable
Expand All @@ -59,48 +67,33 @@
</PropertyGroup>

<ItemGroup>
<!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
to be published. Use DotNetBuildRepo is only set in the internal source build,
and Build.proj is invoked from the wrapper build. -->
<ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(DotNetBuildRepo)' != 'true'" />

<ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)">
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
</ItemsToPushToBlobFeed>
<ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)"
IsShipping="false"
PublishFlatContainer="true"
RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)" />

<ItemsToPushToBlobFeed Include="@(_InstallersToPublish)" Condition="! $([System.String]::Copy('%(Filename)').ToLower().Contains('internal'))">
<ManifestArtifactData>NonShipping=false</ManifestArtifactData>
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
</ItemsToPushToBlobFeed>
<ItemsToPushToBlobFeed Include="@(_InstallersToPublish)"
IsShipping="!$([System.String]::Copy('%(Filename)').ToLower().Contains('internal'))"
PublishFlatContainer="true"
RelativeBlobPath="$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)" />

<ItemsToPushToBlobFeed Include="@(_InstallersToPublish)" Condition="$([System.String]::Copy('%(Filename)').ToLower().Contains('internal'))">
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
</ItemsToPushToBlobFeed>
<ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)"
Condition="'$(PublishInstallerBaseVersion)' == 'true'"
IsShipping="false"
PublishFlatContainer="true"
RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)" />

<ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)</RelativeBlobPath>
</ItemsToPushToBlobFeed>

<ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)</RelativeBlobPath>
</ItemsToPushToBlobFeed>
<ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)"
Condition="'$(PublishInstallerBaseVersion)' == 'true'"
IsShipping="false"
PublishFlatContainer="true"
RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)" />
</ItemGroup>
</Target>

<Target
Name="_WriteProductVersionFile"
Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
Condition="'$(PublishInstallerBaseVersion)' == 'true'">
<!--
This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
and npm project. We use Microsoft.AspNetCore.InternalTesting.csproj because it is non-shipping (we need a non-stable
Expand Down Expand Up @@ -128,4 +121,5 @@
Overwrite="true"
Encoding="ASCII" />
</Target>

</Project>