From: Juan Hoyos Date: Wed, 30 Sep 2020 17:45:10 +0000 (-0700) Subject: Fix issues with single-file and hash generation (#1620) X-Git-Tag: submit/tizen/20210909.063632~17^2~386 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c19c2be6e53433edac3ba79e946668b8393ceab1;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Fix issues with single-file and hash generation (#1620) * Fix SHA512 hashes for blobgroups and wrap pipeline logic in script * Fix single-file tool signing for 5.0-RC1+ SDKs * CR feedback --- diff --git a/diagnostics.yml b/diagnostics.yml index ba82f2442..bd2a0bbbf 100644 --- a/diagnostics.yml +++ b/diagnostics.yml @@ -416,36 +416,9 @@ stages: condition: succeeded() # Create nuget packages, sign binaries and publish to blob feed - - - script: $(Build.SourcesDirectory)\eng\cipack.cmd - -configuration Release - -prepareMachine - -verbosity normal - $(_InternalBuildArgs) - displayName: Package - continueOnError: true - condition: succeeded() - - - script: $(Build.SourcesDirectory)\build.cmd - -configuration Release - -ci - -bundletools - -verbosity normal - $(_InternalBuildArgs) - displayName: Create Single File Bundles - continueOnError: true - condition: succeeded() - - - powershell: $(Build.SourcesDirectory)\eng\common\build.ps1 - -configuration Release - -prepareMachine - -verbosity normal - -restore -publish -sign - -ci -nobl - /bl:$(Build.SourcesDirectory)/artifacts/log/Release/SignPublish.binlog - $(_InternalBuildArgs) - displayName: Sign and generate manifests - continueOnError: true + - script: $(Build.SourcesDirectory)\eng\ci-prepare-artifacts.cmd $(_InternalBuildArgs) + displayName: Package, Sign, and Publish + continueOnError: false condition: succeeded() # Publish package and log build artifacts diff --git a/eng/AfterSigning.targets b/eng/AfterSigning.targets deleted file mode 100644 index 3f3418ae3..000000000 --- a/eng/AfterSigning.targets +++ /dev/null @@ -1,26 +0,0 @@ - - - - - <_SuppressSdkImports>false - - - - - - - %(FullPath).sha512 - - - - - - - - - \ No newline at end of file diff --git a/eng/Publishing.props b/eng/Publishing.props index 78cd0f625..7d0e902f7 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -1,4 +1,10 @@ + + + <_SuppressSdkImports>false + $(ArtifactsDir)bundledtools/ @@ -42,10 +48,22 @@ + + + + %(FullPath).sha512 + + + + + + @@ -53,7 +71,10 @@ <_BlobGroupFilePath>%(PackageFile.FullPath).blobgroup <_ChecksumFilePath>%(PackageFile.FullPath).sha512 - + + + @@ -82,7 +103,7 @@ - + diagnostics/$(_BlobGroupName)/%(_BlobItem.Filename)%(_BlobItem.Extension) true @@ -90,4 +111,5 @@ - \ No newline at end of file + + diff --git a/eng/build.ps1 b/eng/build.ps1 index f1f6cfdd9..722f061bc 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -59,7 +59,7 @@ if ($cleanupprivatebuild) { # Install sdk for building, restore and build managed components. if (-not $skipmanaged) { - Invoke-Expression "& `"$engroot\common\build.ps1`" -build -binaryLog -configuration $configuration -verbosity $verbosity /p:BuildArch=$architecture /p:TestArchitectures=$architecture $remainingargs" + Invoke-Expression "& `"$engroot\common\build.ps1`" -build -configuration $configuration -verbosity $verbosity /p:BuildArch=$architecture /p:TestArchitectures=$architecture $remainingargs" if ($lastExitCode -ne 0) { exit $lastExitCode } diff --git a/eng/ci-prepare-artifacts.cmd b/eng/ci-prepare-artifacts.cmd new file mode 100644 index 000000000..23b321c14 --- /dev/null +++ b/eng/ci-prepare-artifacts.cmd @@ -0,0 +1,22 @@ +@echo off +setlocal + +set "_commonArgs=-restore -ci -prepareMachine -verbosity minimal -configuration Release" +set "_logDir=%~dp0..\artifacts\log\Release\" + +echo Creating packages +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0common\Build.ps1""" %_commonArgs% -pack -noBl /bl:'%_logDir%Pack.binlog' %*" +if NOT '%ERRORLEVEL%' == '0' goto ExitWithCode + +echo Creating bundles +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" %_commonArgs% -bundletools %*" +if NOT '%ERRORLEVEL%' == '0' goto ExitWithCode + +echo Signing and publishing manifest +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0common\Build.ps1""" %_commonArgs% -sign -publish -noBl /bl:'%_logDir%SignPublish.binlog' %*" +if NOT '%ERRORLEVEL%' == '0' goto ExitWithCode + +exit /b 0 + +:ExitWithCode +exit /b !__exitCode! diff --git a/eng/cipack.cmd b/eng/cipack.cmd deleted file mode 100644 index 9e1babf54..000000000 --- a/eng/cipack.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0common\Build.ps1""" -restore -pack -ci %*" -exit /b %ErrorLevel% diff --git a/src/Tools/Directory.Build.targets b/src/Tools/Directory.Build.targets index e5470e05e..ddd6364b6 100644 --- a/src/Tools/Directory.Build.targets +++ b/src/Tools/Directory.Build.targets @@ -19,13 +19,20 @@ This uses the private ItemGroup _FilesToBundle that gets populated in the target chain: ComputeFilesToPublish -> GenerateSingleFileBundle -> _ComputeFilesToBundle. There was no extensibility point to get this, but the single file team confirmed this - would be the cleanest way currently and that it allows to easily consume the extension point when added. --> + would be the cleanest way currently and that it allows to easily consume the extension point when added. + + The exclusion is to make sure we don't sign the apphost before bundling the final tool. + In pre 5.0-rc1 SDK's we have that the single-file host is named after the app. Afterwards + we have it's just called apphost with some metadata. Discard both posibilities. --> - +