From 684ff76979aeb60fc02332c769c8add360ec290c Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 20 Mar 2024 10:43:52 +0100 Subject: [PATCH 01/10] Include versions and checksums in VMR publishing --- eng/Publishing.props | 54 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/eng/Publishing.props b/eng/Publishing.props index 1507fc850339d..c9de99422483a 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -2,22 +2,27 @@ true + + false - - - + + - + + + + + + RelativeBlobPath="Runtime/$(RuntimePackProductVersion)/%(Filename)%(Extension)" /> + + + + + + + + + + + + + + + + + + + From df52116e7e8d3d58e7e0090c4852b19676c7028d Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 20 Mar 2024 10:50:45 +0100 Subject: [PATCH 02/10] Create AfterSigning.targets --- eng/AfterSigning.targets | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 eng/AfterSigning.targets diff --git a/eng/AfterSigning.targets b/eng/AfterSigning.targets new file mode 100644 index 0000000000000..d589d15f5c35e --- /dev/null +++ b/eng/AfterSigning.targets @@ -0,0 +1,23 @@ + + + + <_SuppressSdkImports>false + + + + + + + + + + + From 98f0bb68a01586dc01ef9b9391c95c876bdc8ea7 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 20 Mar 2024 10:52:39 +0100 Subject: [PATCH 03/10] Update Publishing.props --- eng/Publishing.props | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/Publishing.props b/eng/Publishing.props index c9de99422483a..9ba7b81325bdd 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -4,6 +4,7 @@ true false + true + BeforeTargets="PublishToAzureDevOpsArtifacts" + Condition="'$(DotNetBuildRepo)' == 'true'"> true @@ -70,7 +72,7 @@ + RelativeBlobPath="Runtime/$(RuntimePackProductVersion)/%(Filename)%(Extension)" /> From be3b37beceb99a36794c6131c6a31f8fc86f0349 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 20 Mar 2024 11:04:11 +0100 Subject: [PATCH 05/10] Update Publishing.props --- eng/Publishing.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/Publishing.props b/eng/Publishing.props index ed74f2791647f..d33e44c170441 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -37,7 +37,6 @@ $(ArtifactsPackagesDir)**\*.exe; $(ArtifactsPackagesDir)**\*.msi" Exclude="$(ArtifactsPackagesDir)**\Symbols.runtime.tar.gz" /> - - Date: Wed, 20 Mar 2024 11:04:45 +0100 Subject: [PATCH 06/10] Update Publishing.props --- Directory.Build.targets | 25 ----- eng/AfterSigning.targets | 23 ----- eng/Publishing.props | 77 +++++++-------- eng/Signing.props | 42 ++++++--- .../jobs/prepare-signed-artifacts.yml | 1 + .../pkg/projects/Directory.Build.targets | 18 +--- src/installer/prepare-artifacts.proj | 93 ++++++------------- src/installer/tests/Directory.Build.targets | 1 - src/mono/browser/browser.proj | 12 ++- ...t.NET.Runtime.WebAssembly.Templates.csproj | 5 - src/native/corehost/corehost.proj | 2 +- .../installer.tasks/GenerateChecksums.cs | 66 ------------- 12 files changed, 100 insertions(+), 265 deletions(-) delete mode 100644 eng/AfterSigning.targets delete mode 100644 src/tasks/installer.tasks/GenerateChecksums.cs diff --git a/Directory.Build.targets b/Directory.Build.targets index f731eedc390c3..8a06a9c58756f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -201,29 +201,4 @@ - - - - true - true - true - - true - true - true - - -$(VersionSuffix) - $(MajorVersion).$(MinorVersion) - $(ProductBandVersion).$(PatchVersion) - $(ProductionVersion)$(ProductVersionSuffix) - - $(ProductVersion) - $(SharedFrameworkNugetVersion) - Runtime/$(SharedFrameworkNugetVersion)/ - - - diff --git a/eng/AfterSigning.targets b/eng/AfterSigning.targets deleted file mode 100644 index d589d15f5c35e..0000000000000 --- a/eng/AfterSigning.targets +++ /dev/null @@ -1,23 +0,0 @@ - - - - <_SuppressSdkImports>false - - - - - - - - - - - diff --git a/eng/Publishing.props b/eng/Publishing.props index d33e44c170441..82673a0bcfe1b 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -4,57 +4,34 @@ true false - - true + + $(TargetArchitecture) - - + + - + - - - - - - - - - - - - - - + + + + + + @@ -62,15 +39,23 @@ - + + + + + + + - + diff --git a/eng/Signing.props b/eng/Signing.props index f76a7aa22c248..0c5183db05bbd 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -6,16 +6,13 @@ During post build signing, there are no packages to sign during SignFinalPackages. --> - true + true + + false - - - @@ -37,12 +34,6 @@ - - - - - @@ -55,7 +46,13 @@ - + + + + + + @@ -65,4 +62,21 @@ + + + + + + %(FullPath).sha512 + + + diff --git a/eng/pipelines/official/jobs/prepare-signed-artifacts.yml b/eng/pipelines/official/jobs/prepare-signed-artifacts.yml index 908f2b64c71c2..6d5048d165d3d 100644 --- a/eng/pipelines/official/jobs/prepare-signed-artifacts.yml +++ b/eng/pipelines/official/jobs/prepare-signed-artifacts.yml @@ -50,6 +50,7 @@ jobs: -subset publish -configuration Release /p:PublishRidAgnosticPackagesFromPlatform=${{ parameters.PublishRidAgnosticPackagesFromPlatform }} + /p:DownloadDirectory=$(Build.SourcesDirectory)\artifacts\PackageDownload\ /p:OfficialBuildId=$(Build.BuildNumber) /p:SignType=$(SignType) /p:DotNetSignType=$(SignType) diff --git a/src/installer/pkg/projects/Directory.Build.targets b/src/installer/pkg/projects/Directory.Build.targets index 74420fa76bb1f..fcb2c60b44f65 100644 --- a/src/installer/pkg/projects/Directory.Build.targets +++ b/src/installer/pkg/projects/Directory.Build.targets @@ -5,7 +5,9 @@ If we are stabilizing set the StableVersion property for the packages. Needs to happen in Directory.Build.targets to allow all the pkgproj's to set Version property first. --> - $(Version) + $(Version) - $(ProductVersion) - - - - false - true - - .sha512 - $(ArtifactsDir)PackageDownload/ - @@ -15,21 +7,14 @@ - - true - + Before importing the Signing props. --> - - - + + + - - true - + @@ -58,7 +43,7 @@ - @@ -77,43 +62,26 @@ + Properties="DownloadDirectory=$(DownloadDirectory)" /> - + DependsOnTargets="GetNonStableProductVersion;FindDownloadedArtifacts;SignArtifacts;CreateChecksums"> + + false + true + Manifest.xml $(ArtifactsLogDir)AssetManifest/$(AssetManifestFilename) - - $(ProductionVersion) - $(ProductVersion) - - - - - - - - @@ -121,28 +89,27 @@ - $(InstallersRelativePath)%(Filename)%(Extension) + Runtime/$(NonStableProductVersion)/%(Filename)%(Extension) true - $(InstallersRelativePath)%(Filename)%(Extension) - Checksum + Runtime/$(NonStableProductVersion)/%(Filename)%(Extension) true - $(InstallersRelativePath)productVersion.txt + Runtime/$(NonStableProductVersion)/productVersion.txt true - $(InstallersRelativePath)runtime-productVersion.txt + Runtime/$(NonStableProductVersion)/runtime-productVersion.txt true - $(InstallersRelativePath)workloads/%(Filename)%(Extension) + Runtime/$(NonStableProductVersion)/workloads/%(Filename)%(Extension) true @@ -182,13 +149,12 @@ $(DownloadDirectory)IntermediateUnsignedArtifacts\Windows_x64\Shipping\a.nupkg --> - + + - + @@ -226,9 +192,7 @@ Workloads VS insertion artifacts produced by src/workloads/workloads.csproj. Only grab the zip artifacts as they're grouped by SDK feature band which correlates with specific VS versions. --> - + - + - + DestinationPath="%(FullPath).sha512" /> + diff --git a/src/installer/tests/Directory.Build.targets b/src/installer/tests/Directory.Build.targets index ecd79411081d4..9cd2ce6b9c7ed 100644 --- a/src/installer/tests/Directory.Build.targets +++ b/src/installer/tests/Directory.Build.targets @@ -37,7 +37,6 @@ diff --git a/src/mono/browser/browser.proj b/src/mono/browser/browser.proj index 38d6f035e6cf3..f412353247160 100644 --- a/src/mono/browser/browser.proj +++ b/src/mono/browser/browser.proj @@ -533,12 +533,20 @@ <_RollupInputs Include="$(BrowserProjectRoot)runtime/*.js"/> - + + + + + + <_MonoRollupEnvironmentVariable Include="Configuration:$(Configuration)" /> <_MonoRollupEnvironmentVariable Include="NativeBinDir:$(NativeBinDir)" /> <_MonoRollupEnvironmentVariable Include="WasmObjDir:$(WasmObjDir)" /> - <_MonoRollupEnvironmentVariable Include="ProductVersion:$(ProductVersion)" /> + <_MonoRollupEnvironmentVariable Include="ProductVersion:$(RuntimePackProductVersion)" /> <_MonoRollupEnvironmentVariable Include="WasmEnableThreads:$(WasmEnableThreads)" /> <_MonoRollupEnvironmentVariable Include="WASM_ENABLE_SIMD:1" Condition="'$(WasmEnableSIMD)' != 'false'" /> <_MonoRollupEnvironmentVariable Include="WASM_ENABLE_SIMD:0" Condition="'$(WasmEnableSIMD)' == 'false'" /> diff --git a/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj b/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj index 0a4927e350fe7..92c3a12bc4ce0 100644 --- a/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj +++ b/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj @@ -24,10 +24,5 @@ - - - $(ProductVersion) - - diff --git a/src/native/corehost/corehost.proj b/src/native/corehost/corehost.proj index 026cff6928567..ab43e75f9b3e8 100644 --- a/src/native/corehost/corehost.proj +++ b/src/native/corehost/corehost.proj @@ -8,7 +8,7 @@ true - GetProductVersions;GenerateRuntimeVersionFile + GenerateRuntimeVersionFile $(BuildCoreHostDependsOn);InitializeSourceControlInformationFromSourceControlManager $(ArtifactsObjDir)$(OutputRID).$(Configuration)\ diff --git a/src/tasks/installer.tasks/GenerateChecksums.cs b/src/tasks/installer.tasks/GenerateChecksums.cs deleted file mode 100644 index f9e06415523b5..0000000000000 --- a/src/tasks/installer.tasks/GenerateChecksums.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Build.Framework; -using System; -using System.IO; -using System.Security.Cryptography; - -namespace Microsoft.DotNet.Build.Tasks -{ - public class GenerateChecksums : BuildTask - { - /// - /// An item collection of files for which to generate checksums. Each item must have metadata - /// 'DestinationPath' that specifies the path of the checksum file to create. - /// - [Required] - public ITaskItem[] Items { get; set; } - - public override bool Execute() - { - foreach (ITaskItem item in Items) - { - try - { - string destinationPath = item.GetMetadata("DestinationPath"); - if (string.IsNullOrEmpty(destinationPath)) - { - throw new Exception($"Metadata 'DestinationPath' is missing for item '{item.ItemSpec}'."); - } - - if (!File.Exists(item.ItemSpec)) - { - throw new Exception($"The file '{item.ItemSpec}' does not exist."); - } - - Log.LogMessage( - MessageImportance.High, - "Generating checksum for '{0}' into '{1}'...", - item.ItemSpec, - destinationPath); - - using (FileStream stream = File.OpenRead(item.ItemSpec)) - { - using(HashAlgorithm hashAlgorithm = SHA512.Create()) - { - byte[] hash = hashAlgorithm.ComputeHash(stream); - string checksum = BitConverter.ToString(hash).Replace("-", string.Empty); - File.WriteAllText(destinationPath, checksum); - } - } - } - catch (Exception e) - { - // We have 2 log calls because we want a nice error message but we also want to capture the - // callstack in the log. - Log.LogError("An exception occurred while trying to generate a checksum for '{0}'.", item.ItemSpec); - Log.LogMessage(MessageImportance.Low, e.ToString()); - return false; - } - } - - return true; - } - } -} From 65660ec908be9196470062db00c849155d8a5c93 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 25 Mar 2024 15:07:43 +0100 Subject: [PATCH 07/10] Update Signing.props --- eng/Signing.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Signing.props b/eng/Signing.props index 0c5183db05bbd..f0d158463e149 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -7,7 +7,7 @@ During post build signing, there are no packages to sign during SignFinalPackages. --> true - false From 5f3d52a6abf4015a67d4a8c6a06a9ecc01cc16f2 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 26 Mar 2024 06:27:07 +0000 Subject: [PATCH 08/10] Clean-up and fixes --- eng/Publishing.props | 1 - eng/Signing.props | 21 +++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/eng/Publishing.props b/eng/Publishing.props index 82673a0bcfe1b..7e6039a2056de 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -20,7 +20,6 @@ - diff --git a/eng/Signing.props b/eng/Signing.props index 0c5183db05bbd..e6aacc8aa0ddc 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -1,15 +1,12 @@ - - true - - false + + true + + false @@ -46,7 +43,7 @@ - + @@ -64,7 +61,7 @@ - + true @@ -8,6 +8,126 @@ $(TargetArchitecture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -54,8 +174,20 @@ AfterTargets="GenerateChecksumsFromArtifacts"> + RelativeBlobPath="Runtime/$(NonStableProductVersion)/%(Artifact.SubBlobFolder)%(Filename)%(Extension)" /> + + + + + + + diff --git a/eng/Signing.props b/eng/Signing.props index 8af523fc47f6a..34875b1d14d96 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -4,7 +4,7 @@ - true + true false @@ -44,24 +44,7 @@ - - - - - - - - - - - - - - - - - + + + + diff --git a/eng/Subsets.props b/eng/Subsets.props index cbe9cfc7d73c9..e2772f05f1f71 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -198,7 +198,6 @@ - @@ -548,10 +547,6 @@ - - - - diff --git a/eng/pipelines/official/jobs/prepare-signed-artifacts.yml b/eng/pipelines/official/jobs/prepare-signed-artifacts.yml index 6d5048d165d3d..f4bfa85478d9d 100644 --- a/eng/pipelines/official/jobs/prepare-signed-artifacts.yml +++ b/eng/pipelines/official/jobs/prepare-signed-artifacts.yml @@ -46,9 +46,7 @@ jobs: checkDownloadedFiles: true - script: >- - build.cmd -ci - -subset publish - -configuration Release + build.cmd -sign -publish -ci -configuration Release /p:PublishRidAgnosticPackagesFromPlatform=${{ parameters.PublishRidAgnosticPackagesFromPlatform }} /p:DownloadDirectory=$(Build.SourcesDirectory)\artifacts\PackageDownload\ /p:OfficialBuildId=$(Build.BuildNumber) diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 0cc897455e2e0..db129354eb7ec 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -589,10 +589,6 @@ extends: - SourceBuild_linux_x64 jobParameters: nameSuffix: PortableSourceBuild - postBuildSteps: - - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml - parameters: - name: SourceBuildPackages timeoutInMinutes: 95 # diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props index 33a094c082f79..3e898be20b7a8 100644 --- a/src/installer/Directory.Build.props +++ b/src/installer/Directory.Build.props @@ -16,10 +16,4 @@ true - - - $([System.IO.Path]::GetDirectoryName('$(ArcadeSdkBuildTasksAssembly)'))\..\ - $(ArcadeSdkMSBuildProjectDir)Sign.proj - - diff --git a/src/installer/prepare-artifacts.proj b/src/installer/prepare-artifacts.proj deleted file mode 100644 index 2bde0308d1bb4..0000000000000 --- a/src/installer/prepare-artifacts.proj +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - - - - - - - - - - - - - $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI) - - - $(CollectionUri.Split('/')[3]) - - - $(CollectionUri.Split('.')[0].Split('/')[2]) - - - - - - - - - - - - - - - - - - DotNetReleaseShipping=true - - - - - - - - - - - - - false - true - - Manifest.xml - $(ArtifactsLogDir)AssetManifest/$(AssetManifestFilename) - - - - - - - - - Runtime/$(NonStableProductVersion)/%(Filename)%(Extension) - true - - - - Runtime/$(NonStableProductVersion)/%(Filename)%(Extension) - true - - - - Runtime/$(NonStableProductVersion)/productVersion.txt - true - - - - Runtime/$(NonStableProductVersion)/runtime-productVersion.txt - true - - - - Runtime/$(NonStableProductVersion)/workloads/%(Filename)%(Extension) - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -