Skip to content

Commit d78f82a

Browse files
authored
Set correct ProductVersion for productVersion.txt (#54710)
This is just a correctness change and not unblocking any builds. Use the stabilized product version for the productVersion.txt files.
1 parent cdc4376 commit d78f82a

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

eng/Publishing.props

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@
4444
<!-- Remove wixpacks if not doing post-build signing, since they are not needed -->
4545
<_InstallersToPublish Remove="$(ArtifactsDir)installers\**\*.wixpack.zip" Condition="'$(PostBuildSign)' != 'true'" />
4646

47-
<Artifact Include="@(_InstallersToPublish)"
48-
PublishFlatContainer="true">
47+
<Artifact Include="@(_InstallersToPublish)">
4948
<!-- Working around msbuild not being able to negate the result of Contains() outside of targets -->
5049
<IsShipping Condition="$([System.String]::Copy('%(Filename)').ToLowerInvariant().Contains('internal')) == 'True'">false</IsShipping>
5150
<IsShipping Condition="$([System.String]::Copy('%(Filename)').ToLowerInvariant().Contains('internal')) != 'True'">true</IsShipping>
5251
</Artifact>
5352
</ItemGroup>
5453

55-
<Target Name="GetProductVersion">
54+
<Target Name="GetNonStableProductVersion">
5655
<!--
5756
This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
5857
and npm project. We use Microsoft.AspNetCore.InternalTesting.csproj because it is non-shipping (we need a non-stable
@@ -65,14 +64,24 @@
6564
</MSBuild>
6665

6766
<PropertyGroup>
68-
<ProductVersion>%(_ResolvedPackageVersionInfo.PackageVersion)</ProductVersion>
67+
<NonStableProductVersion>%(_ResolvedPackageVersionInfo.PackageVersion)</NonStableProductVersion>
6968
</PropertyGroup>
7069
</Target>
7170

7271
<Target Name="GenerateProductVersionFiles"
7372
BeforeTargets="PublishToAzureDevOpsArtifacts"
74-
DependsOnTargets="GetProductVersion"
73+
DependsOnTargets="GetNonStableProductVersion"
7574
Condition="'$(PublishInstallerBaseVersion)' == 'true'">
75+
<MSBuild Projects="$(RepoRoot)src\Testing\src\Microsoft.AspNetCore.InternalTesting.csproj"
76+
Properties="ExcludeFromBuild=false;IsShipping=true"
77+
Targets="_GetPackageVersionInfo">
78+
<Output TaskParameter="TargetOutputs" ItemName="_ResolvedPackageVersionInfo" />
79+
</MSBuild>
80+
81+
<PropertyGroup>
82+
<ProductVersion>%(_ResolvedPackageVersionInfo.PackageVersion)</ProductVersion>
83+
</PropertyGroup>
84+
7685
<ItemGroup>
7786
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)productVersion.txt" />
7887
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)aspnetcore-productVersion.txt" />
@@ -86,18 +95,17 @@
8695

8796
<ItemGroup>
8897
<Artifact Include="@(ProductVersionFile)"
89-
PublishFlatContainer="true"
90-
RelativeBlobPath="aspnetcore/Runtime/$(ProductVersion)/%(Filename)%(Extension)" />
98+
RelativeBlobPath="aspnetcore/Runtime/$(NonStableProductVersion)/%(Filename)%(Extension)" />
9199
</ItemGroup>
92100
</Target>
93101

94102
<Target Name="AddRelativeBlobPathToInstallerArtifacts"
95103
BeforeTargets="PublishToAzureDevOpsArtifacts"
96104
AfterTargets="GenerateChecksumsFromArtifacts"
97-
DependsOnTargets="GetProductVersion">
105+
DependsOnTargets="GetNonStableProductVersion">
98106
<ItemGroup>
99107
<Artifact Condition="'%(Artifact.PublishFlatContainer)' == 'true' and '%(Artifact.UploadPathSegment)' != ''"
100-
RelativeBlobPath="aspnetcore/%(Artifact.UploadPathSegment)/$(ProductVersion)/%(Filename)%(Extension)" />
108+
RelativeBlobPath="aspnetcore/%(Artifact.UploadPathSegment)/$(NonStableProductVersion)/%(Filename)%(Extension)" />
101109
</ItemGroup>
102110
</Target>
103111

0 commit comments

Comments
 (0)