-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Allow packaging from a zip package to allow for signing #5418
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
Changes from all commits
7d7321e
bba7d86
0c1e2a3
2bf41fb
b3df229
bf2340b
94ca4c3
63ea065
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| dotnet-install.sh | ||
| dotnet-uninstall-debian-packages.sh | ||
| ExpandedBuild/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,34 @@ | |
| "BinaryBucket": "symbols", | ||
| "BinariesExpected": 1, | ||
| "VariableForExtractedBinariesPath": "Symbols_x86" | ||
| }, | ||
| { | ||
| "Name": "win7-x64-package", | ||
| "RepoDestinationPath": "C:\\PowerShell", | ||
| "BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x64 -ReleaseTag _ReleaseTag_", | ||
| "BuildDockerOptions": [ | ||
| "-m", | ||
| "3968m" | ||
|
||
| ], | ||
| "DockerFile": ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\DockerFile", | ||
| "AdditionalContextFiles" :[ ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\PowerShellPackage.ps1"], | ||
| "DockerImageName": "ps-winsrvcore", | ||
| "BinaryBucket": "signed", | ||
| "BinariesExpected": 2 | ||
| }, | ||
| { | ||
| "Name": "win7-x86-package", | ||
| "RepoDestinationPath": "C:\\PowerShell", | ||
| "BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x86 -ReleaseTag _ReleaseTag_", | ||
| "BuildDockerOptions": [ | ||
| "-m", | ||
| "3968m" | ||
| ], | ||
| "DockerFile": ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\DockerFile", | ||
| "AdditionalContextFiles" :[ ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\PowerShellPackage.ps1"], | ||
| "DockerImageName": "ps-winsrvcore", | ||
| "BinaryBucket": "signed", | ||
| "BinariesExpected": 2 | ||
| } | ||
| ], | ||
| "Linux": [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,18 @@ | ||
| [cmdletbinding(DefaultParameterSetName='Build')] | ||
| param( | ||
| [Parameter(ParameterSetName='packageSigned')] | ||
| [Parameter(ParameterSetName='Build')] | ||
| [ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")] | ||
| [string]$ReleaseTag | ||
| [string]$ReleaseTag, | ||
|
|
||
| # full paths to files to add to container to run the build | ||
| [Parameter(Mandatory,ParameterSetName='packageSigned')] | ||
| [string] | ||
| $BuildPath, | ||
|
|
||
| [Parameter(Mandatory,ParameterSetName='packageSigned')] | ||
| [string] | ||
| $SignedFilesPath | ||
| ) | ||
|
|
||
| DynamicParam { | ||
|
|
@@ -37,6 +48,29 @@ Begin { | |
| End { | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| $additionalFiles = @() | ||
| $buildPackageName = $null | ||
| # If specified, Add package file to container | ||
| if ($BuildPath) | ||
| { | ||
| Import-Module (Join-Path -path $PSScriptRoot -childpath '..\..\build.psm1') | ||
| Import-Module (Join-Path -path $PSScriptRoot -childpath '..\packaging') | ||
|
|
||
| # Use temp as destination if not running in VSTS | ||
| $destFolder = $env:temp | ||
| if($env:Build_ArtifactStagingDirectory) | ||
| { | ||
| # Use artifact staging if running in VSTS | ||
| $destFolder = $env:Build_ArtifactStagingDirectory | ||
| } | ||
|
|
||
| $BuildPackagePath = New-PSSignedBuildZip -BuildPath $BuildPath -SignedFilesPath $SignedFilesPath -DestinationFolder $destFolder | ||
| Write-Host "##vso[artifact.upload containerfolder=results;artifactname=$name-singed.zip]$BuildPackagePath" | ||
| $buildPackageName = Split-Path -Path $BuildPackagePath -Leaf | ||
| $additionalFiles += $BuildPackagePath | ||
| } | ||
|
|
||
|
|
||
| $psReleaseBranch = 'master' | ||
| $psReleaseFork = 'PowerShell' | ||
| $location = Join-Path -Path $PSScriptRoot -ChildPath 'PSRelease' | ||
|
|
@@ -74,7 +108,12 @@ End { | |
| Import-Module "$location/dockerBasedBuild" -Force | ||
| Clear-VstsTaskState | ||
|
|
||
| Invoke-Build -RepoPath $resolvedRepoRoot -BuildJsonPath './tools/releaseBuild/build.json' -Name $Name -Parameters $PSBoundParameters | ||
| $buildParameters = @{ | ||
| ReleaseTag = $ReleaseTag | ||
|
||
| BuildPackageName = $buildPackageName | ||
| } | ||
|
|
||
| Invoke-Build -RepoPath $resolvedRepoRoot -BuildJsonPath './tools/releaseBuild/build.json' -Name $Name -Parameters $buildParameters -AdditionalFiles $AdditionalFiles | ||
| } | ||
| catch | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful about the entries
PSModuleRestoreandCrossGenwhen convert to/from json. Currnetly the values of these 2 areSwitchParametervalues, which works fined with the comparison to bool. However, after convert from json, you will get a synthetic property named 'IsPresent' with a bool value, and the comparison to bool would behave differently. See the example:I suggest to not use the
SwitchParametervalue in the first place. Instead, use$CrossGen.IsPresentand$PSModuleRestore.IsPresentwhen setting the initial$optionsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to suggested implementation