Skip to content

Commit 3e78558

Browse files
committed
Update Publishing.props
1 parent be3b37b commit 3e78558

File tree

12 files changed

+100
-265
lines changed

12 files changed

+100
-265
lines changed

Directory.Build.targets

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -201,29 +201,4 @@
201201
</ItemGroup>
202202
</Target>
203203

204-
<!--
205-
Arcade SDK versioning is defined by static properties in a targets file: work around this by
206-
moving properties based on versioning into a target.
207-
-->
208-
<Target Name="GetProductVersions">
209-
<PropertyGroup>
210-
<IncludePreReleaseLabelInPackageVersion Condition="'$(DotNetFinalVersionKind)' != 'release'">true</IncludePreReleaseLabelInPackageVersion>
211-
<IncludePreReleaseLabelInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludePreReleaseLabelInPackageVersion>
212-
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
213-
214-
<IncludeBuildNumberInPackageVersion Condition="'$(StabilizePackageVersion)' != 'true'">true</IncludeBuildNumberInPackageVersion>
215-
<IncludeBuildNumberInPackageVersion Condition="'$(SuppressFinalPackageVersion)' == 'true'">true</IncludeBuildNumberInPackageVersion>
216-
<IncludeBuildNumberInPackageVersion Condition="'$(IsShipping)' != 'true'">true</IncludeBuildNumberInPackageVersion>
217-
218-
<ProductVersionSuffix Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">-$(VersionSuffix)</ProductVersionSuffix>
219-
<ProductBandVersion Condition="'$(ProductBandVersion)' == ''">$(MajorVersion).$(MinorVersion)</ProductBandVersion>
220-
<ProductionVersion Condition="'$(ProductionVersion)' == ''">$(ProductBandVersion).$(PatchVersion)</ProductionVersion>
221-
<ProductVersion>$(ProductionVersion)$(ProductVersionSuffix)</ProductVersion>
222-
223-
<SharedFrameworkNugetVersion>$(ProductVersion)</SharedFrameworkNugetVersion>
224-
<NuGetVersion>$(SharedFrameworkNugetVersion)</NuGetVersion>
225-
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>
226-
</PropertyGroup>
227-
</Target>
228-
229204
</Project>

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="ProductVersionForVersionsFile" />
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="$(ProductVersionForVersionsFile)"
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>

eng/pipelines/official/jobs/prepare-signed-artifacts.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
-subset publish
5151
-configuration Release
5252
/p:PublishRidAgnosticPackagesFromPlatform=${{ parameters.PublishRidAgnosticPackagesFromPlatform }}
53+
/p:DownloadDirectory=$(Build.SourcesDirectory)\artifacts\PackageDownload\
5354
/p:OfficialBuildId=$(Build.BuildNumber)
5455
/p:SignType=$(SignType)
5556
/p:DotNetSignType=$(SignType)

src/installer/pkg/projects/Directory.Build.targets

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
If we are stabilizing set the StableVersion property for the packages.
66
Needs to happen in Directory.Build.targets to allow all the pkgproj's to set Version property first.
77
-->
8-
<StableVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' != 'true'">$(Version)</StableVersion>
8+
<StableVersion Condition="'$(DotNetFinalVersionKind)' == 'release' and
9+
'$(SuppressFinalPackageVersion)' != 'true' and
10+
'$(IsShipping)' == 'true'">$(Version)</StableVersion>
911

1012
<!--
1113
Explicitly re-set the symbol package output path. The pkgproj files here end up importing the targets from
@@ -16,20 +18,6 @@
1618
<SymbolPackageOutputPath>$(PackageOutputPath)</SymbolPackageOutputPath>
1719
</PropertyGroup>
1820

19-
<Target Name="SetTargetBasedPackageVersion"
20-
BeforeTargets="GenerateNuSpec"
21-
DependsOnTargets="GetProductVersions">
22-
<PropertyGroup>
23-
<Version>$(ProductVersion)</Version>
24-
<!--
25-
PackageVersion is normally calculated using Version during static property evaluation, but
26-
we need some info from GetProductVersions, so it's too late to rely on that. We need to set
27-
both in target evaluation, here.
28-
-->
29-
<PackageVersion>$(ProductVersion)</PackageVersion>
30-
</PropertyGroup>
31-
</Target>
32-
3321
<!--
3422
Remove duplicate files returned by restore. The resolve task performs extra detection to pick up
3523
a PDB file for any file listed in the assets file. This causes duplicates if the assets file

0 commit comments

Comments
 (0)