Skip to content

Commit 38b8d1c

Browse files
authored
Simplify Publishing.props (#54566)
* Simplify Publishing.props * Update Publishing.props * Update Publishing.props * Update ci.yml * Update Publishing.props
1 parent 1b2e528 commit 38b8d1c

File tree

2 files changed

+37
-44
lines changed

2 files changed

+37
-44
lines changed

.azure/pipelines/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ stages:
349349
/p:AssetManifestFileName=aspnetcore-win.xml
350350
$(_BuildArgs)
351351
$(_PublishArgs)
352-
/p:PublishInstallerBaseVersion=true
353352
$(_InternalRuntimeDownloadArgs)
354353
$(WindowsArm64InstallersLogArgs)
355354
displayName: Build ARM64 Installers

eng/Publishing.props

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
<Project>
2-
<PropertyGroup>
3-
<PublishingVersion>3</PublishingVersion>
4-
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
5-
</PropertyGroup>
62

73
<PropertyGroup>
8-
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksumsAndProductVersion</PublishDependsOnTargets>
9-
4+
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
105
<_UploadPathRoot>aspnetcore</_UploadPathRoot>
116
<ProductVersionFileName>productVersion.txt</ProductVersionFileName>
127
<RepoProductVersionFileName>$(_UploadPathRoot)-$(ProductVersionFileName)</RepoProductVersionFileName>
138
<ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation>
149
<RepoProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(RepoProductVersionFileName)</RepoProductVersionFileLocation>
10+
11+
<!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
12+
Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
13+
the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
14+
to be published. Use DotNetBuildRepo is only set in the internal source build,
15+
and Build.proj is invoked from the wrapper build. -->
16+
<EnableDefaultPublishItems Condition="'$(OS)' != 'Windows_NT' and
17+
'$(PostBuildSign)' != 'true' and
18+
'$(DotNetBuildRepo)' != 'true'">false</EnableDefaultPublishItems>
19+
20+
<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == '' and '$(EnableDefaultPublishItems)' == 'true'">true</PublishInstallerBaseVersion>
21+
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
22+
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
1523
</PropertyGroup>
1624

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

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

6169
<ItemGroup>
62-
<!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
63-
Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
64-
the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
65-
to be published. Use DotNetBuildRepo is only set in the internal source build,
66-
and Build.proj is invoked from the wrapper build. -->
67-
<ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT' and '$(PostBuildSign)' != 'true' and '$(DotNetBuildRepo)' != 'true'" />
68-
69-
<ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)">
70-
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
71-
<PublishFlatContainer>true</PublishFlatContainer>
72-
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
73-
</ItemsToPushToBlobFeed>
70+
<ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)"
71+
IsShipping="false"
72+
PublishFlatContainer="true"
73+
RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)" />
7474

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

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

87-
<ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
88-
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
89-
<PublishFlatContainer>true</PublishFlatContainer>
90-
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)</RelativeBlobPath>
91-
</ItemsToPushToBlobFeed>
92-
93-
<ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
94-
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
95-
<PublishFlatContainer>true</PublishFlatContainer>
96-
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)</RelativeBlobPath>
97-
</ItemsToPushToBlobFeed>
86+
<ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)"
87+
Condition="'$(PublishInstallerBaseVersion)' == 'true'"
88+
IsShipping="false"
89+
PublishFlatContainer="true"
90+
RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)" />
9891
</ItemGroup>
9992
</Target>
10093

10194
<Target
10295
Name="_WriteProductVersionFile"
103-
Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
96+
Condition="'$(PublishInstallerBaseVersion)' == 'true'">
10497
<!--
10598
This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
10699
and npm project. We use Microsoft.AspNetCore.InternalTesting.csproj because it is non-shipping (we need a non-stable
@@ -128,4 +121,5 @@
128121
Overwrite="true"
129122
Encoding="ASCII" />
130123
</Target>
124+
131125
</Project>

0 commit comments

Comments
 (0)