Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ param (

[Parameter(Mandatory,ParameterSetName='packageSigned')]
[ValidatePattern("-signed.zip$")]
[string]$BuildZip
[string]$BuildZip,

[Parameter(Mandatory,ParameterSetName='ComponentRegistration')]
[switch] $ComponentRegistration
)

$releaseTagParam = @{}
Expand Down Expand Up @@ -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
}
}
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++
}

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
Compress-Archive -Path $projectAssetsFolder -DestinationPath $projectAssetsZip
Remove-Item -Path $projectAssetsFolder -Recurse -Force -ErrorAction SilentlyContinue
}

}
finally
{
Expand Down
19 changes: 19 additions & 0 deletions tools/releaseBuild/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down