Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish the official build to blob storage #1092

Merged
merged 2 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/official/stages/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ stages:
# Allow symbol publish to emit expected warnings without failing the build. Include single
# quotes inside the string so that it passes through to MSBuild without script interference.
symbolPublishingAdditionalParameters: "'-warnAsError:$false'"
# Publish to blob storage.
publishInstallersAndChecksums: true
# Enable SDL validation, passing through values from the 'core-setup-sdl-validation' group.
SDLValidationParameters:
enable: false # TODO: (Consolidation) Decide who owns SDL validation errors and enable. https://github.com/dotnet/runtime/issues/1027
Expand Down
1 change: 0 additions & 1 deletion src/installer/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
<HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' != 'true'">$(ProductVersion)</HostPolicyVersion>
<HostPolicyVersion Condition="'$(UseShippedHostPolicyPackage)' == 'true'">2.0.0</HostPolicyVersion>

<BinariesRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</BinariesRelativePath>
<InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)/</InstallersRelativePath>
</PropertyGroup>

Expand Down
42 changes: 37 additions & 5 deletions src/installer/publish/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,30 @@
are published from every job. RID-agnostic nupkgs are built with the same ID/version by
every job, so one specific job's outputs must be picked to sign and publish.
-->

<!-- RID-specific framework packs. -->
<RuntimeNupkgFile
Include="
$(DownloadDirectory)**\runtime.*.nupkg;
$(DownloadDirectory)**\*.Runtime.*.nupkg;
$(DownloadDirectory)**\*.App.Host.*.nupkg;
$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
$(DownloadDirectory)**\Microsoft.*.Runtime.*.nupkg;
$(DownloadDirectory)**\Microsoft.*.App.Host.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />

<!-- VS insertion packages, carrying RID-specific installers. -->
<RuntimeNupkgFile
Include="$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
Exclude="@(DownloadedSymbolNupkgFile)" />

<!--
Runtime packages associated with some identity packages. Need to exclude "runtime.native.*"
because Libraries produces some "runtime.native.Foo" packages with
"runtime.<rid>.runtime.native.Foo" identity packages.
-->
<RuntimeNupkgFile
Include="$(DownloadDirectory)**\runtime.*.nupkg"
Exclude="
$(DownloadDirectory)**\runtime.native.*.nupkg;
@(DownloadedSymbolNupkgFile)" />

<!--
Packages that aren't matched above as RID-specific are considered RID-agnostic. Also include
the AllConfigurations packages from the Libraries build.
Expand All @@ -61,9 +77,15 @@
reasons, such as the VS insertion packages that transport MSIs. Symbol package validation
will check for symbol completeness with file-by-file granularity rather than looking for
missing symbols.nupkg files: https://github.com/dotnet/arcade/issues/2499.

Handles several conventions:
* NonShipping packages have symbol nupkgs that are Shipping.
* Shipping packages have symbol packages in a "symbols" subdirectory.
-->
<PotentialSymbolNupkgToPublishFile
Include="@(NupkgToPublishFile->Replace('\NonShipping\', '\Shipping\')->Replace('.nupkg', '.symbols.nupkg'))" />
Include="
@(NupkgToPublishFile->Replace('\NonShipping\', '\Shipping\')->Replace('.nupkg', '.symbols.nupkg'));
@(NupkgToPublishFile->Replace('\Shipping\', '\Shipping\symbols\')->Replace('.nupkg', '.symbols.nupkg'))" />

<SymbolNupkgToPublishFile
Include="@(PotentialSymbolNupkgToPublishFile)"
Expand All @@ -75,6 +97,16 @@
<Error
Condition="'@(SymbolNupkgToPublishFile)' == ''"
Text="No symbol packages found." />

<!--
Duplicate RuntimeNupkgFile items mean artifact upload will fail, but only after another hour
of signing. Detect this early. It's possible to automatically "fix" this with Distinct(),
however the patterns should be fairly specific: this is likely a build infra mistake that
should be corrected.
-->
<Error
Text="Duplicate RuntimeNupkgFile entries for: %(RuntimeNupkgFile.Identity)"
Condition="@(RuntimeNupkgFile->Count()) &gt; 1" />
</Target>

<Import Project="..\Directory.Build.targets" />
Expand Down
37 changes: 32 additions & 5 deletions src/installer/publish/prepare-artifacts.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<UsingTask TaskName="GenerateChecksums" AssemblyFile="$(InstallerTasksAssemblyPath)" />

<PropertyGroup>
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>
</PropertyGroup>

<Target Name="CreateChecksums">
<ItemGroup>
<ArtifactsForGeneratingChecksums
Include="@(UploadToBlobStorageFile)"
DestinationPath="%(FullPath)$(ChecksumExtension)" />

<GeneratedChecksumFile Include="@(ArtifactsForGeneratingChecksums -> '%(DestinationPath)')" />
</ItemGroup>

<GenerateChecksums Items="@(ArtifactsForGeneratingChecksums)" />
</Target>

<Target Name="SignPackages"
Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'">
<Message Importance="High" Text="Signing final packages" />
Expand All @@ -13,12 +31,17 @@
<Target Name="UploadPreparedArtifactsToPipeline"
DependsOnTargets="
FindDownloadedArtifacts;
SignPackages">
SignPackages;
CreateChecksums">
<PropertyGroup>
<PreparedFileUploadDir>$(ArtifactsObjDir)PreparedFileUpload\</PreparedFileUploadDir>
</PropertyGroup>

<Copy SourceFiles="@(UploadToBlobStorageFile)" DestinationFolder="$(PreparedFileUploadDir)">
<ItemGroup>
<AllFilesToBlobStorage Include="@(UploadToBlobStorageFile);@(UploadToBlobStorageFile)" />
</ItemGroup>

<Copy SourceFiles="@(AllFilesToBlobStorage)" DestinationFolder="$(PreparedFileUploadDir)">
<Output TaskParameter="CopiedFiles" ItemName="CopiedUploadToBlobStorageFile" />
</Copy>

Expand Down Expand Up @@ -96,9 +119,13 @@

<ItemsToPush
Include="@(UploadToBlobStorageFile)"
Exclude="@(NupkgToPublishFile);@(SymbolNupkgToPublishFile)" />
<ItemsToPush>
<RelativeBlobPath>assets/core-setup/$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
Exclude="@(NupkgToPublishFile);@(SymbolNupkgToPublishFile)">
<RelativeBlobPath>$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
</ItemsToPush>

<ItemsToPush Include="@(GeneratedChecksumFile)">
<RelativeBlobPath>$(InstallersRelativePath)%(Filename)%(Extension)</RelativeBlobPath>
<Category>Checksum</Category>
</ItemsToPush>
</ItemGroup>

Expand Down
75 changes: 0 additions & 75 deletions src/installer/publish/publish-blobs.proj

This file was deleted.