Skip to content

Always generate checksums as last part of publish job #20367

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

Merged
merged 9 commits into from
Apr 1, 2020
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
1 change: 1 addition & 0 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ variables:
# The following extra properties are not set when testing. Use with final build.[cmd,sh] of asset-producing jobs.
- name: _PublishArgs
value: /p:Publish=true
/p:GenerateChecksums=true
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@

<ArchiveExtension>.tar.gz</ArchiveExtension>
<ArchiveExtension Condition="'$(TargetOsName)' == 'win'">.zip</ArchiveExtension>
<ChecksumExtension>.sha512</ChecksumExtension>
</PropertyGroup>

<Import Project="eng\Workarounds.props" />
Expand Down
33 changes: 33 additions & 0 deletions eng/AfterSigning.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(GenerateChecksums)' == 'true'" />

<PropertyGroup Condition="'$(GenerateChecksums)' == 'true'">
<!-- The one use of ArtifactsDir in Publish.proj adds an additional slash, confusing itself. -->
<ArtifactsDir Condition=" HasTrailingSlash('$(ArtifactsDir)') ">$(ArtifactsDir.Substring(0, $([MSBuild]::Subtract($(ArtifactsDir.Length), 1))))</ArtifactsDir>
<!-- $(InstallersOutputPath) is not defined. Root Directory.Build.props is not imported. -->
<InstallersOutputPath>$(ArtifactsDir)\installers\</InstallersOutputPath>
</PropertyGroup>

<Target Name="PopulateGenerateChecksumItems"
Condition="'$(GenerateChecksums)' == 'true'"
AfterTargets="Build"
BeforeTargets="GenerateChecksums" >

<ItemGroup>
<InstallerFiles Include="$(InstallersOutputPath)**\*.msi" />
<InstallerFiles Include="$(InstallersOutputPath)**\*.exe" />
<InstallerFiles Include="$(InstallersOutputPath)**\*.zip" />
<InstallerFiles Include="$(InstallersOutputPath)**\*.tar.gz" />
<InstallerFiles Include="$(InstallersOutputPath)**\*.wixlib" />
<InstallerFiles Include="$(InstallersOutputPath)**\*.rpm" />
<GenerateChecksumItems Include="%(InstallerFiles.Identity)" >
<DestinationPath>%(FullPath).sha512</DestinationPath>
</GenerateChecksumItems>
</ItemGroup>

</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(GenerateChecksums)' == 'true'" />

</Project>
6 changes: 2 additions & 4 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup Condition=" HasTrailingSlash('$(ArtifactsDir)') ">
<PropertyGroup>
<!-- The one use of ArtifactsDir in Publish.proj adds an additional slash, confusing itself. -->
<ArtifactsDir>$(ArtifactsDir.Substring(0, $([MSBuild]::Subtract($(ArtifactsDir.Length), 1))))</ArtifactsDir>
<ArtifactsDir Condition=" HasTrailingSlash('$(ArtifactsDir)') ">$(ArtifactsDir.Substring(0, $([MSBuild]::Subtract($(ArtifactsDir.Length), 1))))</ArtifactsDir>

<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksums</PublishDependsOnTargets>

Expand Down Expand Up @@ -49,12 +49,10 @@
<!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows. -->
<ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT'" />

<!-- Skip publishing checksums for now - the checksums for the .zip files don't match (https://github.com/dotnet/aspnetcore/issues/18792)
<ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)">
<PublishFlatContainer>true</PublishFlatContainer>
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
</ItemsToPushToBlobFeed>
-->

<ItemsToPushToBlobFeed Include="@(_InstallersToPublish)">
<IsShipping>true</IsShipping>
Expand Down
6 changes: 0 additions & 6 deletions src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<RedistArchiveOutputPath>$(InstallersOutputPath)$(RedistArchiveOutputFileName)</RedistArchiveOutputPath>
</PropertyGroup>

<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<GenerateChecksumItems Include="$(RedistArchiveOutputPath)">
<DestinationPath>$(RedistArchiveOutputPath)$(ChecksumExtension)</DestinationPath>
</GenerateChecksumItems>
</ItemGroup>

<!-- Target chain -->
<PropertyGroup>
<ResolveReferencesDependsOn>
Expand Down
8 changes: 1 addition & 7 deletions src/Installers/Windows/Wix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,12 @@

<Target Name="CopyToArtifactsDirectory"
Condition=" '$(IsShipping)' == 'true' AND '$(SkipCopyToArtifactsDirectory)' != 'true' "
AfterTargets="Build" BeforeTargets="GenerateChecksums">
BeforeTargets="Build">
<Copy SourceFiles="$(TargetPath)" DestinationFiles="$(InstallersOutputPath)$(PackageFileName)" />
<ItemGroup>
<_cabs Include="$(TargetDir)**/*.cab" />
</ItemGroup>
<Copy SourceFiles="@(_cabs)" DestinationFolder="$(InstallersOutputPath)" />
</Target>

<ItemGroup Condition=" '$(IsShipping)' == 'true' AND '$(SkipCopyToArtifactsDirectory)' != 'true' ">
<GenerateChecksumItems Include="$(InstallersOutputPath)$(PackageFileName)">
<DestinationPath>$(InstallersOutputPath)$(PackageFileName)$(ChecksumExtension)</DestinationPath>
</GenerateChecksumItems>
</ItemGroup>

</Project>