|
2 | 2 |
|
3 | 3 | <PropertyGroup>
|
4 | 4 | <ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
|
5 |
| - <_UploadPathRoot>aspnetcore</_UploadPathRoot> |
6 |
| - <ProductVersionFileName>productVersion.txt</ProductVersionFileName> |
7 |
| - <RepoProductVersionFileName>$(_UploadPathRoot)-$(ProductVersionFileName)</RepoProductVersionFileName> |
8 |
| - <ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation> |
9 |
| - <RepoProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(RepoProductVersionFileName)</RepoProductVersionFileLocation> |
10 | 5 |
|
11 | 6 | <!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows.
|
12 | 7 | Do not remove if post build sign is true, as we avoid the xplat codesign jobs, and need to have
|
13 | 8 | the nupkgs pushed. Do not do this if building from source, since we want the source build intermediate package
|
14 | 9 | to be published. Use DotNetBuildRepo is only set in the internal source build,
|
15 | 10 | 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> |
| 11 | + <EnableDefaultArtifacts Condition="'$(OS)' != 'Windows_NT' and |
| 12 | + '$(PostBuildSign)' != 'true' and |
| 13 | + '$(DotNetBuildRepo)' != 'true'">false</EnableDefaultArtifacts> |
19 | 14 |
|
20 |
| - <PublishInstallerBaseVersion Condition="'$(OS)' == 'Windows_NT' or '$(DotNetBuildRepo)' == 'true'">true</PublishInstallerBaseVersion> |
| 15 | + <PublishInstallerBaseVersion Condition="'$(OS)' == 'Windows_NT' or '$(DotNetBuildOrchestrator)' == 'true'">true</PublishInstallerBaseVersion> |
21 | 16 | <!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
|
22 | 17 | <AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
|
23 | 18 | </PropertyGroup>
|
|
26 | 21 | <ItemGroup>
|
27 | 22 | <!-- Include our "loose" PDBs when publishing symbols. -->
|
28 | 23 | <FilesToPublishToSymbolServer Include="$(ArtifactsDir)symbols\**\*.pdb" />
|
29 |
| - <WixPacksToPublish Include="$(ArtifactsDir)installers\**\*.wixpack.zip" /> |
30 | 24 |
|
31 | 25 | <!-- Prepare for _PublishInstallersAndChecksums target. -->
|
32 |
| - <_InstallersToPublish Remove="@(_InstallersToPublish)" /> |
33 | 26 | <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.jar" UploadPathSegment="jar" />
|
34 | 27 | <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.pom" UploadPathSegment="jar" />
|
35 | 28 | <!-- All builds produce npm assets - only publish them once -->
|
36 |
| - <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" Condition="'$(OS)' == 'Windows_NT' or '$(DotNetBuildRepo)' == 'true'" /> |
37 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.deb" UploadPathSegment="Runtime" /> |
38 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.exe" UploadPathSegment="Runtime" /> |
39 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.msi" UploadPathSegment="Runtime" /> |
40 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.rpm" UploadPathSegment="Runtime" /> |
41 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.tar.gz" UploadPathSegment="Runtime" /> |
| 29 | + <_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" Condition="'$(OS)' == 'Windows_NT' or '$(DotNetBuildOrchestrator)' == 'true'" /> |
42 | 30 | <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.version" UploadPathSegment="Runtime" Condition="'$(PublishInstallerBaseVersion)' == 'true'" />
|
43 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.wixlib" UploadPathSegment="Runtime" /> |
44 |
| - <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.zip" UploadPathSegment="Runtime" /> |
| 31 | + |
| 32 | + <!-- The following installers create checksums --> |
| 33 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.deb" UploadPathSegment="Runtime" ChecksumPath="%(FullPath).sha512" /> |
| 34 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.exe" UploadPathSegment="Runtime" ChecksumPath="%(FullPath).sha512" /> |
| 35 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.msi" UploadPathSegment="Runtime" ChecksumPath="%(FullPath).sha512" /> |
| 36 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.rpm" UploadPathSegment="Runtime" ChecksumPath="%(FullPath).sha512" /> |
| 37 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.tar.gz" UploadPathSegment="Runtime" ChecksumPath="%(FullPath).sha512" /> |
| 38 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.wixlib" UploadPathSegment="Runtime" ChecksumPath="%(FullPath).sha512" /> |
| 39 | + <_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.zip" UploadPathSegment="Runtime" > |
| 40 | + <!-- Exclude wixpack.zip files from checksum generation --> |
| 41 | + <ChecksumPath Condition="$([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.wixpack.zip')) != 'true'">%(FullPath).sha512</ChecksumPath> |
| 42 | + </_InstallersToPublish> |
| 43 | + |
45 | 44 | <!-- Remove wixpacks if not doing post-build signing, since they are not needed -->
|
46 |
| - <_InstallersToPublish Remove="@(WixPacksToPublish)" Condition="'$(PostBuildSign)' != 'true'" /> |
47 |
| - <_ChecksumsToPublish Include="$(ArtifactsDir)installers\**\*.sha512" /> |
| 45 | + <_InstallersToPublish Remove="$(ArtifactsDir)installers\**\*.wixpack.zip" Condition="'$(PostBuildSign)' != 'true'" /> |
| 46 | + |
| 47 | + <Artifact Include="@(_InstallersToPublish)" |
| 48 | + PublishFlatContainer="true"> |
| 49 | + <!-- Working around msbuild not being able to negate the result of Contains() outside of targets --> |
| 50 | + <IsShipping Condition="$([System.String]::Copy('%(Filename)').ToLowerInvariant().Contains('internal')) == 'True'">false</IsShipping> |
| 51 | + <IsShipping Condition="$([System.String]::Copy('%(Filename)').ToLowerInvariant().Contains('internal')) != 'True'">true</IsShipping> |
| 52 | + </Artifact> |
48 | 53 | </ItemGroup>
|
49 | 54 |
|
50 |
| - <Target |
51 |
| - Name="_PublishInstallersAndChecksumsAndProductVersion" |
52 |
| - DependsOnTargets="_WriteProductVersionFile" |
53 |
| - BeforeTargets="PublishToAzureDevOpsArtifacts"> |
| 55 | + <Target Name="GetProductVersion"> |
54 | 56 | <!--
|
55 | 57 | This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
|
56 | 58 | and npm project. We use Microsoft.AspNetCore.InternalTesting.csproj because it is non-shipping (we need a non-stable
|
|
63 | 65 | </MSBuild>
|
64 | 66 |
|
65 | 67 | <PropertyGroup>
|
66 |
| - <_PackageVersion>@(_ResolvedPackageVersionInfo->'%(PackageVersion)')</_PackageVersion> |
| 68 | + <ProductVersion>%(_ResolvedProductVersionInfo.PackageVersion)</ProductVersion> |
67 | 69 | </PropertyGroup>
|
| 70 | + </Target> |
68 | 71 |
|
| 72 | + <Target Name="GenerateProductVersionFiles" |
| 73 | + BeforeTargets="PublishToAzureDevOpsArtifacts" |
| 74 | + DependsOnTargets="GetProductVersion" |
| 75 | + Condition="'$(PublishInstallerBaseVersion)' == 'true'"> |
69 | 76 | <ItemGroup>
|
70 |
| - <ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)" |
71 |
| - IsShipping="false" |
72 |
| - PublishFlatContainer="true" |
73 |
| - RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)" /> |
74 |
| - |
75 |
| - <ItemsToPushToBlobFeed Include="@(_InstallersToPublish)" |
76 |
| - IsShipping="!$([System.String]::Copy('%(Filename)').ToLower().Contains('internal'))" |
77 |
| - PublishFlatContainer="true" |
78 |
| - RelativeBlobPath="$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)" /> |
| 77 | + <ProductVersionFile Include="$(ArtifactsShippingPackagesDir)productVersion.txt" /> |
| 78 | + <ProductVersionFile Include="$(ArtifactsShippingPackagesDir)aspnetcore-productVersion.txt" /> |
| 79 | + </ItemGroup> |
79 | 80 |
|
80 |
| - <ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)" |
81 |
| - Condition="'$(PublishInstallerBaseVersion)' == 'true'" |
82 |
| - IsShipping="false" |
83 |
| - PublishFlatContainer="true" |
84 |
| - RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)" /> |
| 81 | + <!-- Generate productVersion.txt file containing the product version. --> |
| 82 | + <WriteLinesToFile File="%(ProductVersionFile.Identity)" |
| 83 | + Lines="$(ProductVersion)" |
| 84 | + Overwrite="true" |
| 85 | + Encoding="ASCII" /> |
85 | 86 |
|
86 |
| - <ItemsToPushToBlobFeed Include="$(RepoProductVersionFileLocation)" |
87 |
| - Condition="'$(PublishInstallerBaseVersion)' == 'true'" |
88 |
| - IsShipping="false" |
89 |
| - PublishFlatContainer="true" |
90 |
| - RelativeBlobPath="$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(RepoProductVersionFileName)" /> |
| 87 | + <ItemGroup> |
| 88 | + <Artifact Include="@(ProductVersionFile)" |
| 89 | + PublishFlatContainer="true" |
| 90 | + RelativeBlobPath="aspnetcore/Runtime/$(ProductVersion)/%(Filename)%(Extension)" /> |
91 | 91 | </ItemGroup>
|
92 | 92 | </Target>
|
93 | 93 |
|
94 |
| - <Target |
95 |
| - Name="_WriteProductVersionFile" |
96 |
| - Condition="'$(PublishInstallerBaseVersion)' == 'true'"> |
97 |
| - <!-- |
98 |
| - This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#, |
99 |
| - and npm project. We use Microsoft.AspNetCore.InternalTesting.csproj because it is non-shipping (we need a non-stable |
100 |
| - version string to use as our publish location) non-packed (won't be shipped in the future). |
101 |
| - --> |
102 |
| - <MSBuild Projects="$(RepoRoot)src\Testing\src\Microsoft.AspNetCore.InternalTesting.csproj" |
103 |
| - Properties="ExcludeFromBuild=false" |
104 |
| - Targets="_GetPackageVersionInfo"> |
105 |
| - <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProductVersionInfo" /> |
106 |
| - </MSBuild> |
107 |
| - |
108 |
| - <PropertyGroup> |
109 |
| - <_ProductVersion>%(_ResolvedProductVersionInfo.PackageVersion)</_ProductVersion> |
110 |
| - </PropertyGroup> |
111 |
| - |
112 |
| - <!-- Generate productVersion.txt containing the value of $(PackageVersion) --> |
113 |
| - <WriteLinesToFile |
114 |
| - File="$(ProductVersionFileLocation)" |
115 |
| - Lines="$(_ProductVersion)" |
116 |
| - Overwrite="true" |
117 |
| - Encoding="ASCII" /> |
118 |
| - <WriteLinesToFile |
119 |
| - File="$(RepoProductVersionFileLocation)" |
120 |
| - Lines="$(_ProductVersion)" |
121 |
| - Overwrite="true" |
122 |
| - Encoding="ASCII" /> |
| 94 | + <Target Name="AddRelativeBlobPathToInstallerArtifacts" |
| 95 | + BeforeTargets="PublishToAzureDevOpsArtifacts" |
| 96 | + AfterTargets="GenerateChecksumsFromArtifacts" |
| 97 | + DependsOnTargets="GetProductVersion"> |
| 98 | + <ItemGroup> |
| 99 | + <Artifact Condition="'%(Artifact.PublishFlatContainer)' == 'true' and '%(Artifact.UploadPathSegment)' != ''" |
| 100 | + RelativeBlobPath="aspnetcore/%(Artifact.UploadPathSegment)/$(ProductVersion)/%(Filename)%(Extension)" /> |
| 101 | + </ItemGroup> |
123 | 102 | </Target>
|
124 | 103 |
|
125 | 104 | </Project>
|
0 commit comments