Skip to content

Commit 637ca31

Browse files
authored
[release/5.0] Upload ProductVersion.txt to blob feed (#28482)
* Upload ProductVersion.txt to blob feed * Only upload file during Winx64/x86 build * Deduplicate prop name
1 parent 462cb89 commit 637ca31

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

eng/Publishing.props

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
</PropertyGroup>
55

66
<PropertyGroup>
7-
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksums</PublishDependsOnTargets>
7+
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksumsAndProductVersion</PublishDependsOnTargets>
88

99
<_UploadPathRoot>aspnetcore</_UploadPathRoot>
10+
<ProductVersionFileName>productVersion.txt</ProductVersionFileName>
11+
<ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation>
1012
</PropertyGroup>
1113

1214
<!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
@@ -31,7 +33,9 @@
3133
<_ChecksumsToPublish Include="$(ArtifactsDir)**\*.sha512" />
3234
</ItemGroup>
3335

34-
<Target Name="_PublishInstallersAndChecksums">
36+
<Target
37+
Name="_PublishInstallersAndChecksumsAndProductVersion"
38+
DependsOnTargets="_WriteProductVersionFile">
3539
<!--
3640
This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
3741
and npm project. We use SignalR.Npm.FunctionalTests.npmproj because it is non-shipping (we need a non-stable
@@ -69,6 +73,38 @@
6973
<PublishFlatContainer>true</PublishFlatContainer>
7074
<RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
7175
</ItemsToPushToBlobFeed>
76+
77+
<ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
78+
<PublishFlatContainer>true</PublishFlatContainer>
79+
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)</RelativeBlobPath>
80+
</ItemsToPushToBlobFeed>
7281
</ItemGroup>
7382
</Target>
83+
84+
<Target
85+
Name="_WriteProductVersionFile"
86+
Condition=" '$(PublishInstallerBaseVersion)' == 'true'">
87+
<!--
88+
This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
89+
and npm project. We use Microsoft.AspNetCore.App.Runtime.csproj because it is shipping (we need a stable
90+
version string to use for productVersion.txt).
91+
-->
92+
<MSBuild Projects="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
93+
Properties="DisableYarnCheck=true;ExcludeFromBuild=false"
94+
Targets="_GetPackageVersionInfo"
95+
SkipNonexistentProjects="false">
96+
<Output TaskParameter="TargetOutputs" ItemName="_ResolvedProductVersionInfo" />
97+
</MSBuild>
98+
99+
<PropertyGroup>
100+
<_ProductVersion>@(_ResolvedProductVersionInfo->'%(PackageVersion)')</_ProductVersion>
101+
</PropertyGroup>
102+
103+
<!-- Generate productVersion.txt containing the value of $(PackageVersion) -->
104+
<WriteLinesToFile
105+
File="$(ProductVersionFileLocation)"
106+
Lines="$(_ProductVersion)"
107+
Overwrite="true"
108+
Encoding="ASCII" />
109+
</Target>
74110
</Project>

0 commit comments

Comments
 (0)