From 417fe5c83b3b5e05fe950384d42bd35a64bd4496 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 4 Nov 2020 12:53:03 -0800 Subject: [PATCH] Update the release build to work with new module artifacts (#1930) - Use a new builder pool, which has the latest PowerShell 7.0.3 available. - Remove catalog related steps, as the catalog file is unnecessary to PowerShell Gallery now. - Update the signing xml file to sign the new "Polyfiller" assemblies. --- .vsts-ci/releaseBuild.yml | 37 +++------------------------------- .vsts-ci/sign-catalog.xml | 8 -------- .vsts-ci/sign-module-files.xml | 3 ++- PSReadLine.build.ps1 | 12 ----------- 4 files changed, 5 insertions(+), 55 deletions(-) delete mode 100644 .vsts-ci/sign-catalog.xml diff --git a/.vsts-ci/releaseBuild.yml b/.vsts-ci/releaseBuild.yml index 9340e780..f7e62ff2 100644 --- a/.vsts-ci/releaseBuild.yml +++ b/.vsts-ci/releaseBuild.yml @@ -17,7 +17,7 @@ resources: jobs: - job: build_windows - pool: Package ES Lab A + pool: Package ES CodeHub Lab E # APIScan can take a long time timeoutInMinutes: 240 @@ -86,39 +86,14 @@ jobs: - pwsh: | # Show the signed files Get-ChildItem -Path $(Signed) - Copy-Item -Path $(Signed)\* -Destination $(PSReadLine) -Force + Copy-Item -Path $(Signed)\* -Destination $(PSReadLine) -Recurse -Force displayName: 'Replace unsigned files with signed ones' - # Create catalog file from the signed modules files - - pwsh: | - New-FileCatalog -CatalogFilePath $(PSReadLine)\PSReadLine.cat -Path $(PSReadLine) -CatalogVersion 2.0 | ` - ForEach-Object -MemberName FullName - displayName: 'Create catalog file' - - # Sign the catalog file - - task: PkgESCodeSign@10 - displayName: 'CodeSign - catalog file' - env: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - inputs: - signConfigXml: '$(Build.SourcesDirectory)\.vsts-ci\sign-catalog.xml' - inPathRoot: '$(PSReadLine)' - outPathRoot: '$(Signed)' - binVersion: Production - binVersionOverride: '' - - # Copy the signed catalog file over - - pwsh: | - # Show the signed files - Get-ChildItem -Path $(Signed) - Copy-Item -Path $(Signed)\PSReadLine.cat -Destination $(PSReadLine) -Force - displayName: 'Replace catalog file with the signed one' - # Verify the signatures - pwsh: | $HasInvalidFiles = $false $WrongCert = @{} - Get-ChildItem -Path $(PSReadLine) -Recurse -Include "*.dll","*.ps*1*","*.cat" | ` + Get-ChildItem -Path $(PSReadLine) -Recurse -Include "*.dll","*.ps*1*" | ` Get-AuthenticodeSignature | ForEach-Object { $_ | Select-Object Path, Status if ($_.Status -ne 'Valid') { $HasInvalidFiles = $true } @@ -134,12 +109,6 @@ jobs: } displayName: 'Verify the signed files' - - pwsh: | - $CatInfo = Test-FileCatalog -Path $(PSReadLine) -CatalogFilePath $(PSReadLine)\PSReadLine.cat -Detailed - $CatInfo | Format-List - if ($CatInfo.Status -ne "Valid") { throw "Catalog file is invalid." } - displayName: 'Verify the catalog file' - - pwsh: | try { $RepoName = "PSRLLocal" diff --git a/.vsts-ci/sign-catalog.xml b/.vsts-ci/sign-catalog.xml deleted file mode 100644 index 45ffaba8..00000000 --- a/.vsts-ci/sign-catalog.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/.vsts-ci/sign-module-files.xml b/.vsts-ci/sign-module-files.xml index 946a6b5e..53f88b52 100644 --- a/.vsts-ci/sign-module-files.xml +++ b/.vsts-ci/sign-module-files.xml @@ -9,6 +9,7 @@ - + + diff --git a/PSReadLine.build.ps1 b/PSReadLine.build.ps1 index 80bb0664..b07930b5 100644 --- a/PSReadLine.build.ps1 +++ b/PSReadLine.build.ps1 @@ -91,18 +91,6 @@ task BuildMockPSConsole @mockPSConsoleParams { exec { dotnet publish -f $Framework -c $Configuration MockPSConsole } } -<# -Synopsis: Generate the file catalog -#> -task GenerateCatalog { - exec { - Remove-Item -ea Ignore $PSScriptRoot/bin/$Configuration/PSReadLine/PSReadLine.cat - $null = New-FileCatalog -CatalogFilePath $PSScriptRoot/bin/$Configuration/PSReadLine/PSReadLine.cat ` - -Path $PSScriptRoot/bin/$Configuration/PSReadLine ` - -CatalogVersion 2.0 - } -} - <# Synopsis: Run the unit tests #>