Skip to content

Commit bdb6a38

Browse files
authored
Publish Checksums to dotnetclichecksums storage account (#19038)
* Update dependencies from Arcade * Try publishing checksums * Fix some errors * Set RelativeBlobPath * Fix publish location * Centralize ChecksumExtension * Fix use of ChecksumExtension in publishing.props
1 parent 7fc314f commit bdb6a38

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173

174174
<ArchiveExtension>.tar.gz</ArchiveExtension>
175175
<ArchiveExtension Condition="'$(TargetOsName)' == 'win'">.zip</ArchiveExtension>
176+
<ChecksumExtension>.sha512</ChecksumExtension>
176177
</PropertyGroup>
177178

178179
<Import Project="eng\Workarounds.props" />

eng/Publishing.props

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
<!-- The one use of ArtifactsDir in Publish.proj adds an additional slash, confusing itself. -->
44
<ArtifactsDir>$(ArtifactsDir.Substring(0, $([MSBuild]::Subtract($(ArtifactsDir.Length), 1))))</ArtifactsDir>
55

6-
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallers</PublishDependsOnTargets>
6+
<PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksums</PublishDependsOnTargets>
77

88
<_UploadPathRoot>aspnetcore</_UploadPathRoot>
99
</PropertyGroup>
1010

11-
<!-- $(InstallersOutputPath) and $(SymbolsOutputPath) are not defined. Root Directory.Build.props is not imported. -->
11+
<!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
1212
<ItemGroup>
1313
<!-- Include our "loose" PDBs when publishing symbols. -->
1414
<FilesToPublishToSymbolServer Include="$(ArtifactsDir)\symbols\**\*.pdb" />
1515

16-
<!-- Prepare for _PublishInstallers target. -->
16+
<!-- Prepare for _PublishInstallersAndChecksums target. -->
1717
<_InstallersToPublish Remove="@(_InstallersToPublish)" />
1818
<_InstallersToPublish Include="$(ArtifactsDir)\packages\**\*.jar" UploadPathSegment="jar" />
1919
<_InstallersToPublish Include="$(ArtifactsDir)\packages\**\*.pom" UploadPathSegment="jar" />
@@ -27,9 +27,10 @@
2727
Condition=" '$(PublishInstallerBaseVersion)' == 'true' " />
2828
<_InstallersToPublish Include="$(ArtifactsDir)\installers\**\*.wixlib" UploadPathSegment="Runtime" />
2929
<_InstallersToPublish Include="$(ArtifactsDir)\installers\**\*.zip" UploadPathSegment="Runtime" />
30+
<_ChecksumsToPublish Include="$(ArtifactsDir)\**\*.sha512" />
3031
</ItemGroup>
3132

32-
<Target Name="_PublishInstallers">
33+
<Target Name="_PublishInstallersAndChecksums">
3334
<!--
3435
This target is defined in eng/targets/Packaging.targets and included in every C# and F# project.
3536
We use Microsoft.AspNetCore.DeveloperCertificates.XPlat because it is a nonshipping package, and we need a non-stable version string to use as our publish location.
@@ -48,6 +49,11 @@
4849
<!-- Do not push .nupkg files from Linux and macOS builds. They'll be packed up separately and signed on Windows. -->
4950
<ItemsToPushToBlobFeed Remove="@(ItemsToPushToBlobFeed)" Condition="'$(OS)' != 'Windows_NT'" />
5051

52+
<ItemsToPushToBlobFeed Include="@(_ChecksumsToPublish)">
53+
<PublishFlatContainer>true</PublishFlatContainer>
54+
<RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
55+
</ItemsToPushToBlobFeed>
56+
5157
<ItemsToPushToBlobFeed Include="@(_InstallersToPublish)">
5258
<IsShipping>true</IsShipping>
5359
<ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData>

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant
154154
<RedistArchiveOutputPath>$(InstallersOutputPath)$(RedistArchiveOutputFileName)</RedistArchiveOutputPath>
155155
</PropertyGroup>
156156

157+
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
158+
<GenerateChecksumItems Include="$(RedistArchiveOutputPath)">
159+
<DestinationPath>$(RedistArchiveOutputPath)$(ChecksumExtension)</DestinationPath>
160+
</GenerateChecksumItems>
161+
</ItemGroup>
162+
157163
<!-- Target chain -->
158164
<PropertyGroup>
159165
<ResolveReferencesDependsOn>

src/Installers/Windows/Wix.targets

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,18 @@
6464

6565
<Target Name="CopyToArtifactsDirectory"
6666
Condition=" '$(IsShipping)' == 'true' AND '$(SkipCopyToArtifactsDirectory)' != 'true' "
67-
AfterTargets="Build">
67+
AfterTargets="Build" BeforeTargets="GenerateChecksums">
6868
<Copy SourceFiles="$(TargetPath)" DestinationFiles="$(InstallersOutputPath)$(PackageFileName)" />
6969
<ItemGroup>
7070
<_cabs Include="$(TargetDir)**/*.cab" />
7171
</ItemGroup>
7272
<Copy SourceFiles="@(_cabs)" DestinationFolder="$(InstallersOutputPath)" />
7373
</Target>
7474

75+
<ItemGroup Condition=" '$(IsShipping)' == 'true' AND '$(SkipCopyToArtifactsDirectory)' != 'true' ">
76+
<GenerateChecksumItems Include="$(InstallersOutputPath)$(PackageFileName)">
77+
<DestinationPath>$(InstallersOutputPath)$(PackageFileName)$(ChecksumExtension)</DestinationPath>
78+
</GenerateChecksumItems>
79+
</ItemGroup>
80+
7581
</Project>

0 commit comments

Comments
 (0)