mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Enable NuGet Package Registration for compliance (#7053)
update the Windows release build script with the ability to capture all the project.assets.json files add a Windows build to use the new feature in the release build script update the Linux release build script with the ability to capture all the project.assets.json files -no new build is needed because signing is not currently automated
This commit is contained in:
@@ -58,3 +58,20 @@ foreach ($linuxPackage in $linuxPackages)
|
||||
Write-Verbose "Copying $filePath to $destination" -Verbose
|
||||
Copy-Item -Path $filePath -Destination $destination -force
|
||||
}
|
||||
|
||||
Write-Verbose "Exporting project.assets files ..." -verbose
|
||||
|
||||
$projectAssetsCounter = 1
|
||||
$projectAssetsFolder = Join-Path -Path $destination -ChildPath 'projectAssets'
|
||||
$projectAssetsZip = Join-Path -Path $destination -ChildPath 'projectAssetssymbols.zip'
|
||||
Get-ChildItem $location\project.assets.json -Recurse | ForEach-Object {
|
||||
$itemDestination = Join-Path -Path $projectAssetsFolder -ChildPath $projectAssetsCounter
|
||||
New-Item -Path $itemDestination -ItemType Directory -Force
|
||||
$file = $_.FullName
|
||||
Write-Verbose "Copying $file to $itemDestination" -verbose
|
||||
Copy-Item -Path $file -Destination "$itemDestination\" -Force
|
||||
$projectAssetsCounter++
|
||||
}
|
||||
|
||||
Compress-Archive -Path $projectAssetsFolder -DestinationPath $projectAssetsZip
|
||||
Remove-Item -Path $projectAssetsFolder -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
@@ -7,4 +7,6 @@ LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>"
|
||||
RUN apk update \
|
||||
&& apk add cmake clang build-base git bash
|
||||
|
||||
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
COPY build-and-run-pwsh.sh /
|
||||
|
||||
@@ -23,5 +23,7 @@ RUN yum install -y \
|
||||
|
||||
COPY PowerShellPackage.ps1 /
|
||||
|
||||
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
# Use PowerShell as the default shell
|
||||
ENTRYPOINT [ "pwsh" ]
|
||||
|
||||
@@ -32,5 +32,7 @@ RUN apt-get update \
|
||||
|
||||
COPY PowerShellPackage.ps1 /
|
||||
|
||||
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
# Use PowerShell as the default shell
|
||||
ENTRYPOINT [ "pwsh" ]
|
||||
|
||||
@@ -30,5 +30,7 @@ RUN apt-get update \
|
||||
|
||||
COPY PowerShellPackage.ps1 /
|
||||
|
||||
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
# Use PowerShell as the default shell
|
||||
ENTRYPOINT [ "pwsh" ]
|
||||
|
||||
@@ -21,4 +21,6 @@ RUN Import-Module ./containerFiles/wix.psm1; `
|
||||
|
||||
COPY PowerShellPackage.ps1 /
|
||||
|
||||
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
ENTRYPOINT ["C:\\Program Files\\PowerShell\\latest\\pwsh.exe", "-command"]
|
||||
|
||||
+36
-11
@@ -25,7 +25,10 @@ param (
|
||||
|
||||
[Parameter(Mandatory,ParameterSetName='packageSigned')]
|
||||
[ValidatePattern("-signed.zip$")]
|
||||
[string]$BuildZip
|
||||
[string]$BuildZip,
|
||||
|
||||
[Parameter(Mandatory,ParameterSetName='ComponentRegistration')]
|
||||
[switch] $ComponentRegistration
|
||||
)
|
||||
|
||||
$releaseTagParam = @{}
|
||||
@@ -92,24 +95,46 @@ try{
|
||||
}
|
||||
|
||||
$pspackageParams = @{'Type'='msi'; 'WindowsRuntime'=$Runtime}
|
||||
if(!$Symbols.IsPresent -and $Runtime -notmatch "arm")
|
||||
if(!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notmatch "arm")
|
||||
{
|
||||
Write-Verbose "Starting powershell packaging(msi)..." -verbose
|
||||
Start-PSPackage @pspackageParams @releaseTagParam
|
||||
}
|
||||
|
||||
$pspackageParams['Type']='zip'
|
||||
$pspackageParams['IncludeSymbols']=$Symbols.IsPresent
|
||||
Write-Verbose "Starting powershell packaging(zip)..." -verbose
|
||||
Start-PSPackage @pspackageParams @releaseTagParam
|
||||
if(!$ComponentRegistration.IsPresent)
|
||||
{
|
||||
$pspackageParams['Type']='zip'
|
||||
$pspackageParams['IncludeSymbols']=$Symbols.IsPresent
|
||||
Write-Verbose "Starting powershell packaging(zip)..." -verbose
|
||||
Start-PSPackage @pspackageParams @releaseTagParam
|
||||
|
||||
Write-Verbose "Exporting packages ..." -verbose
|
||||
Write-Verbose "Exporting packages ..." -verbose
|
||||
|
||||
Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb | ForEach-Object {
|
||||
$file = $_.FullName
|
||||
Write-Verbose "Copying $file to $destination" -verbose
|
||||
Copy-Item -Path $file -Destination "$destination\" -Force
|
||||
Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb | ForEach-Object {
|
||||
$file = $_.FullName
|
||||
Write-Verbose "Copying $file to $destination" -verbose
|
||||
Copy-Item -Path $file -Destination "$destination\" -Force
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Verbose "Exporting project.assets files ..." -verbose
|
||||
|
||||
$projectAssetsCounter = 1
|
||||
$projectAssetsFolder = Join-Path -Path $destination -ChildPath 'projectAssets'
|
||||
$projectAssetsZip = Join-Path -Path $destination -ChildPath 'projectAssetssymbols.zip'
|
||||
Get-ChildItem $location\project.assets.json -Recurse | ForEach-Object {
|
||||
$itemDestination = Join-Path -Path $projectAssetsFolder -ChildPath $projectAssetsCounter
|
||||
New-Item -Path $itemDestination -ItemType Directory -Force
|
||||
$file = $_.FullName
|
||||
Write-Verbose "Copying $file to $itemDestination" -verbose
|
||||
Copy-Item -Path $file -Destination "$itemDestination\" -Force
|
||||
$projectAssetsCounter++
|
||||
}
|
||||
|
||||
Compress-Archive -Path $projectAssetsFolder -DestinationPath $projectAssetsZip
|
||||
Remove-Item -Path $projectAssetsFolder -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@@ -34,6 +34,25 @@
|
||||
"DockerImageName": "ps-winsrvcore",
|
||||
"BinaryBucket": "release"
|
||||
},
|
||||
{
|
||||
"Name": "win-x64-component-registration",
|
||||
"RepoDestinationPath": "C:\\PowerShell",
|
||||
"BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x64 -ReleaseTag _ReleaseTag_ -ComponentRegistration",
|
||||
"BuildDockerOptions": [
|
||||
"-m",
|
||||
"3968m"
|
||||
],
|
||||
"DockerFile": ".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\DockerFile",
|
||||
"AdditionalContextFiles" :[
|
||||
".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\PowerShellPackage.ps1",
|
||||
".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\wix.psm1",
|
||||
".\\tools\\releaseBuild\\Images\\microsoft_powershell_windowsservercore\\dockerInstall.psm1"
|
||||
],
|
||||
"DockerImageName": "ps-winsrvcore",
|
||||
"BinaryBucket": "results",
|
||||
"ArtifactsExpected": 1,
|
||||
"VariableForExtractedBinariesPath": "componentregistration"
|
||||
},
|
||||
{
|
||||
"Name": "win-x64-symbols",
|
||||
"RepoDestinationPath": "C:\\PowerShell",
|
||||
|
||||
Reference in New Issue
Block a user