Skip to content
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

Update the release build #1930

Merged
merged 4 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
37 changes: 3 additions & 34 deletions .vsts-ci/releaseBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:

jobs:
- job: build_windows
pool: Package ES Lab A
pool: Package ES CodeHub Lab E
Copy link
Member

Choose a reason for hiding this comment

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

This should be the standard pool Package ES Standard Build. Did you have problems using it? It seems you had it in one of your previous commits

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the build didn't start when using Package ES Standard Build. It says something like "it doesn't exist or I don't have permission". I copied this one from Paul's SecretManagement release build.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just sent the email to request adding the agent pool to PSReadLine. I will update the pool name once the agent pool is added and my access is clear.
Before that, I would like to go with "Package ES CodeHub Lab E", as I need to release 2.2.0-beta1 today or tomorrow.


# APIScan can take a long time
timeoutInMinutes: 240
Expand Down Expand Up @@ -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 }
Expand All @@ -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"
Expand Down
8 changes: 0 additions & 8 deletions .vsts-ci/sign-catalog.xml

This file was deleted.

2 changes: 2 additions & 0 deletions .vsts-ci/sign-module-files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@

<file src="__INPATHROOT__\Microsoft.PowerShell.PSReadLine2.dll" signType="AuthenticodeFormer" dest="__OUTPATHROOT__\Microsoft.PowerShell.PSReadLine2.dll" />
<file src="__INPATHROOT__\System.Runtime.InteropServices.RuntimeInformation.dll" signType="AuthenticodeFormer" dest="__OUTPATHROOT__\System.Runtime.InteropServices.RuntimeInformation.dll" />
<file src="__INPATHROOT__\net461\Microsoft.PowerShell.PSReadLine.Polyfiller.dll" signType="AuthenticodeFormer" dest="__OUTPATHROOT__\net461\Microsoft.PowerShell.PSReadLine.Polyfiller.dll" />
<file src="__INPATHROOT__\net5.0\Microsoft.PowerShell.PSReadLine.Polyfiller.dll" signType="AuthenticodeFormer" dest="__OUTPATHROOT__\net5.0\Microsoft.PowerShell.PSReadLine.Polyfiller.dll" />
</job>
</SignConfigXML>
12 changes: 0 additions & 12 deletions PSReadLine.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
#>
Expand Down