Skip to content

Commit 3533944

Browse files
committed
Update Publishing.props
1 parent be3b37b commit 3533944

File tree

4 files changed

+63
-110
lines changed

4 files changed

+63
-110
lines changed

eng/AfterSigning.targets

Lines changed: 0 additions & 23 deletions
This file was deleted.

eng/Publishing.props

Lines changed: 31 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,58 @@
44
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
55
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
66
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
7-
<!-- TODO: Change condition when runtime's official publishing starts using Publishing.props:
8-
https://github.com/dotnet/source-build/issues/4239 -->
9-
<EnableDefaultPublishItems Condition="'$(DotNetBuildRepo)' == 'true'">true</EnableDefaultPublishItems>
7+
<!-- Set PlatformName to TargetArchitecture to create unique build manifest files. -->
8+
<PlatformName Condition="'$(TargetArchitecture)' != ''">$(TargetArchitecture)</PlatformName>
109
</PropertyGroup>
1110

12-
<!-- Retrieve the runtime pack product version.
13-
Don't stabilize the package version in order to retrieve the VersionSuffix. -->
14-
<Target Name="GetProductVersion">
11+
<Target Name="GetNonStableProductVersion">
12+
<!-- Retrieve the non-stable runtime pack product version.
13+
Don't stabilize the package version in order to retrieve the VersionSuffix. -->
1514
<MSBuild Projects="$(RepoRoot)src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj"
1615
Targets="ReturnProductVersion"
1716
Properties="IsShipping=false;
1817
Crossgen2SdkOverridePropsPath=;
1918
Crossgen2SdkOverrideTargetsPath=">
20-
<Output TaskParameter="TargetOutputs" PropertyName="RuntimePackProductVersion" />
19+
<Output TaskParameter="TargetOutputs" PropertyName="NonStableProductVersion" />
2120
</MSBuild>
2221
</Target>
2322

24-
<!-- Include installer archives and packages which aren't globbed by default.
25-
Don't include Symbols archive as it is already included in Arcade's Publish.proj, with correct blob path. -->
26-
<Target Name="PublishInstallers"
27-
DependsOnTargets="GetProductVersion"
28-
BeforeTargets="PublishToAzureDevOpsArtifacts"
29-
Condition="'$(DotNetBuildRepo)' == 'true'">
30-
31-
<ItemGroup>
32-
<InstallerToPublish Include="$(ArtifactsPackagesDir)**\*.tar.gz;
33-
$(ArtifactsPackagesDir)**\*.zip;
34-
$(ArtifactsPackagesDir)**\*.deb;
35-
$(ArtifactsPackagesDir)**\*.rpm;
36-
$(ArtifactsPackagesDir)**\*.pkg;
37-
$(ArtifactsPackagesDir)**\*.exe;
38-
$(ArtifactsPackagesDir)**\*.msi"
39-
Exclude="$(ArtifactsPackagesDir)**\Symbols.runtime.tar.gz" />
40-
<ItemsToPushToBlobFeed Include="@(InstallerToPublish)"
41-
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))"
42-
PublishFlatContainer="true"
43-
RelativeBlobPath="Runtime/$(RuntimePackProductVersion)/%(Filename)%(Extension)" />
44-
45-
<!-- Include checksums -->
46-
<ChecksumToPublish Include="$(ArtifactsPackagesDir)**\*.sha512" />
47-
<ItemsToPushToBlobFeed Include="@(ChecksumToPublish)"
48-
IsShipping="false"
49-
PublishFlatContainer="true"
50-
RelativeBlobPath="Runtime/$(RuntimePackProductVersion)/%(Filename)%(Extension)" />
51-
</ItemGroup>
52-
</Target>
53-
54-
<Target Name="GenerateAndPublishProductVersionFiles"
55-
DependsOnTargets="GetProductVersion"
56-
Condition="'$(EnableDefaultPublishItems)' == 'true'"
23+
<!-- This target only runs when EnableDefaultArtifacts=true which is a single build leg in CI. -->
24+
<Target Name="GenerateProductVersionFiles"
25+
DependsOnTargets="GetNonStableProductVersion"
5726
BeforeTargets="PublishToAzureDevOpsArtifacts">
27+
<!-- Retrieve the runtime pack product version. -->
28+
<MSBuild Projects="$(RepoRoot)src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj"
29+
Targets="ReturnProductVersion"
30+
Properties="Crossgen2SdkOverridePropsPath=;
31+
Crossgen2SdkOverrideTargetsPath=">
32+
<Output TaskParameter="TargetOutputs" PropertyName="ProductVersion" />
33+
</MSBuild>
34+
5835
<ItemGroup>
5936
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)productVersion.txt" />
6037
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)runtime-productVersion.txt" />
6138
</ItemGroup>
6239

6340
<!-- Generate productVersion.txt file containing the product version. -->
6441
<WriteLinesToFile File="%(ProductVersionFile.Identity)"
65-
Lines="$(RuntimePackProductVersion)"
42+
Lines="$(ProductVersion)"
6643
Overwrite="true"
6744
Encoding="ASCII" />
68-
45+
46+
<ItemGroup>
47+
<Artifact Include="@(ProductVersionFile)"
48+
RelativeBlobPath="Runtime/$(NonStableProductVersion)/%(Filename)%(Extension)" />
49+
</ItemGroup>
50+
</Target>
51+
52+
<Target Name="AddRelativeBlobPathToInstallerArtifacts"
53+
DependsOnTargets="GetNonStableProductVersion"
54+
BeforeTargets="PublishToAzureDevOpsArtifacts"
55+
AfterTargets="GenerateChecksumsFromArtifacts">
6956
<ItemGroup>
70-
<ItemsToPushToBlobFeed Include="@(ProductVersionFile)"
71-
IsShipping="false"
72-
PublishFlatContainer="true"
73-
RelativeBlobPath="Runtime/$(RuntimePackProductVersion)/%(Filename)%(Extension)" />
57+
<Artifact Condition="'%(Artifact.PublishFlatContainer)' == 'true' and '%(Artifact.RelativeBlobPath)' == ''"
58+
RelativeBlobPath="Runtime/$(NonStableProductVersion)/%(Filename)%(Extension)" />
7459
</ItemGroup>
7560
</Target>
7661

eng/Signing.props

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
77
During post build signing, there are no packages to sign during SignFinalPackages.
88
-->
9-
<AllowEmptySignList>true</AllowEmptySignList>
9+
<AllowEmptySignList Condition="'$(DotNetBuildOrchestrator)' != 'true'">true</AllowEmptySignList>
10+
<!-- TODO: Change condition when runtime's official publishing starts using Publishing.proj:
11+
https://github.com/dotnet/source-build/issues/4239 -->
12+
<EnableDefaultArtifacts Condition="'$(DotNetBuildOrchestrator)' != 'true'">false</EnableDefaultArtifacts>
1013
</PropertyGroup>
1114

1215
<ItemGroup>
13-
<!--
14-
Replace the default items to sign with the specific set we want. This allows the build to call
15-
Arcade's Sign.proj multiple times for different sets of files as the build progresses.
16-
-->
17-
<ItemsToSign Remove="@(ItemsToSign)" />
18-
1916
<!-- apphost and comhost template files are not signed, by design. -->
2017
<FileSignInfo Include="apphost.exe;singlefilehost.exe;comhost.dll" CertificateName="None" />
2118

@@ -37,12 +34,6 @@
3734
<FileSignInfo Include="Mono.Cecil.Pdb.dll" CertificateName="3PartySHA2" />
3835
<FileSignInfo Include="Mono.Cecil.Rocks.dll" CertificateName="3PartySHA2" />
3936

40-
<!-- Exclude symbol packages from have a NuGet signature. These are never pushed to NuGet.org or
41-
other feeds (in fact, that have identical identity to their non-symbol variant) -->
42-
<DownloadedSymbolPackages Include="$(DownloadDirectory)**\*.symbols.nupkg" />
43-
<DownloadedSymbolPackagesWithoutPaths Include="@(DownloadedSymbolPackages->'%(Filename)%(Extension)')" />
44-
<FileSignInfo Include="@(DownloadedSymbolPackagesWithoutPaths->Distinct())" CertificateName="None" />
45-
4637
<FileExtensionSignInfo Include=".msi" CertificateName="MicrosoftDotNet500" />
4738
<FileExtensionSignInfo Include=".pkg" CertificateName="8003" />
4839
<FileExtensionSignInfo Include=".deb;.rpm" CertificateName="LinuxSign" />
@@ -55,7 +46,13 @@
5546
<FileSignInfo Update="@(FileSignInfo->WithMetadataValue('CertificateName','Microsoft400'))" CertificateName="MicrosoftDotNet500" />
5647
</ItemGroup>
5748

58-
<ItemGroup Condition="'$(PrepareArtifacts)' == 'true'">
49+
<ItemGroup Condition="'$(EnableDefaultArtifacts)' != 'true'">
50+
<!-- Exclude symbol packages from have a NuGet signature. These are never pushed to NuGet.org or
51+
other feeds (in fact, that have identical identity to their non-symbol variant) -->
52+
<DownloadedSymbolPackages Include="$(DownloadDirectory)**\*.symbols.nupkg" />
53+
<DownloadedSymbolPackagesWithoutPaths Include="@(DownloadedSymbolPackages->'%(Filename)%(Extension)')" />
54+
<FileSignInfo Include="@(DownloadedSymbolPackagesWithoutPaths->Distinct())" CertificateName="None" />
55+
5956
<ItemsToSignWithPaths Include="$(DownloadDirectory)**\*.msi" />
6057
<ItemsToSignWithPaths Include="$(DownloadDirectory)**\*.exe" />
6158
<ItemsToSignWithPaths Include="$(DownloadDirectory)**\*.nupkg" />
@@ -65,4 +62,21 @@
6562
<ItemsToSignPostBuild Include="@(ItemsToSignWithoutPaths->Distinct())" Condition="'$(PostBuildSign)' == 'true'" />
6663
<ItemsToSign Include="@(ItemsToSignWithPaths->Distinct())" Condition="'$(PostBuildSign)' != 'true'" />
6764
</ItemGroup>
65+
66+
<!-- Include installers -->
67+
<ItemGroup Condition="'$(EnableDefaultArtifacts)' == 'true'">
68+
<Artifact Include="$(ArtifactsPackagesDir)**\*.tar.gz;
69+
$(ArtifactsPackagesDir)**\*.zip;
70+
$(ArtifactsPackagesDir)**\*.deb;
71+
$(ArtifactsPackagesDir)**\*.rpm;
72+
$(ArtifactsPackagesDir)**\*.pkg;
73+
$(ArtifactsPackagesDir)**\*.exe;
74+
$(ArtifactsPackagesDir)**\*.msi"
75+
Exclude="$(ArtifactsPackagesDir)**\Symbols.runtime.tar.gz"
76+
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))">
77+
<!-- Exclude wixpack.zip files from checksum generation -->
78+
<ChecksumPath Condition="$([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.wixpack.zip')) != 'true'">%(FullPath).sha512</ChecksumPath>
79+
</Artifact>
80+
</ItemGroup>
81+
6882
</Project>

src/installer/prepare-artifacts.proj

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515

1616
<!-- When doing post build sign, pull in the arcade sign.props file, which will
1717
create some initial sign groups and then pulls in the repo's custom Signing.props overrides.
18-
Before importing the signing props. Set PrepareArtifactst=true. Depending on context (SDK project vs. not),
19-
the initial imports of livebuilds.targets and Configuration.props are already imported and thus cannot
20-
be imported again. Without those imports, the globbing of files to sign will not work properly. -->
21-
<PropertyGroup>
22-
<PrepareArtifacts>true</PrepareArtifacts>
23-
</PropertyGroup>
18+
Before importing the Signing props. -->
2419
<Import Project="../tools/Sign.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
2520

2621
<Import Project="$(RepositoryEngineeringDir)Publishing.props" Condition="Exists('$(RepositoryEngineeringDir)Publishing.props')" />
@@ -78,39 +73,21 @@
7873
Projects="$(ArcadeSdkSignProject)"
7974
Targets="Sign"
8075
Properties="
81-
DownloadDirectory=$(DownloadDirectory);
82-
PrepareArtifacts=$(PrepareArtifacts)" />
76+
DownloadDirectory=$(DownloadDirectory)" />
8377
</Target>
8478

8579
<!--
8680
Take assets from the build jobs, prepare them for publishing (signing, arrangement) then upload
8781
them to the pipeline for Arcade and custom steps to publish.
8882
-->
89-
<Target Name="PreparePublishToAzureBlobFeed"
83+
<Target Name="PublishToAzureDevOpsArtifacts"
9084
AfterTargets="Build"
91-
DependsOnTargets="GetProductVersions;FindDownloadedArtifacts;SignArtifacts;CreateChecksums">
85+
DependsOnTargets="FindDownloadedArtifacts;SignArtifacts;CreateChecksums">
9286
<PropertyGroup>
9387
<AssetManifestFilename>Manifest.xml</AssetManifestFilename>
9488
<AssetManifestFile>$(ArtifactsLogDir)AssetManifest/$(AssetManifestFilename)</AssetManifestFile>
95-
96-
<ProductVersionTxtContents Condition="'$(StabilizePackageVersion)'=='true'">$(ProductionVersion)</ProductVersionTxtContents>
97-
<ProductVersionTxtContents Condition="'$(StabilizePackageVersion)'!='true'">$(ProductVersion)</ProductVersionTxtContents>
9889
</PropertyGroup>
9990

100-
<!-- Generate productVersion.txt containing the value of $(PackageVersion) -->
101-
<WriteLinesToFile
102-
File="$(ArtifactsShippingPackagesDir)productVersion.txt"
103-
Lines="$(ProductVersionTxtContents)"
104-
Overwrite="true"
105-
Encoding="ASCII" />
106-
107-
<!-- Generate runtime-productVersion.txt containing the value of $(PackageVersion) -->
108-
<WriteLinesToFile
109-
File="$(ArtifactsShippingPackagesDir)runtime-productVersion.txt"
110-
Lines="$(ProductVersionTxtContents)"
111-
Overwrite="true"
112-
Encoding="ASCII" />
113-
11491
<ItemGroup>
11592
<ItemsToPush Remove="@(ItemsToPush)" />
11693

0 commit comments

Comments
 (0)