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
47 changes: 16 additions & 31 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,6 @@ function Compress-CoverageArtifacts
return $artifacts
}

function Get-PackageName
{
$name = git describe
# Remove 'v' from version, prepend 'PowerShell' - to be consistent with other package names
$name = $name -replace 'v',''
$name = 'PowerShell_' + $name
return $name
}

function Get-ReleaseTag
{
$metaDataPath = Join-Path -Path $PSScriptRoot -ChildPath 'metadata.json'
Expand All @@ -450,30 +441,14 @@ function Invoke-AppveyorFinish
try {
$releaseTag = Get-ReleaseTag

$packageParams = @{}
if($env:APPVEYOR_BUILD_VERSION)
{
$packageParams += @{ReleaseTag=$releaseTag}
}

# Build packages
$packages = Start-PSPackage @packageParams -SkipReleaseChecks

$name = Get-PackageName

$zipFilePath = Join-Path $pwd "$name.zip"

Add-Type -assemblyname System.IO.Compression.FileSystem
Write-Verbose "Zipping ${env:CoreOutput} into $zipFilePath" -verbose
[System.IO.Compression.ZipFile]::CreateFromDirectory($env:CoreOutput, $zipFilePath)
$packages = Start-PSPackage -Type msi,nupkg,zip -ReleaseTag $releaseTag -SkipReleaseChecks

$artifacts = New-Object System.Collections.ArrayList
foreach ($package in $packages) {
$null = $artifacts.Add($package)
}

$null = $artifacts.Add($zipFilePath)

if ($env:APPVEYOR_REPO_TAG_NAME)
{
$preReleaseVersion = $env:APPVEYOR_REPO_TAG_NAME
Expand All @@ -492,17 +467,27 @@ function Invoke-AppveyorFinish
$preReleaseVersion = "$previewPrefix-$previewLabel.$env:APPVEYOR_BUILD_NUMBER"
}

# only publish to nuget feed if it is a daily build and tests passed
# only publish assembly nuget packages if it is a daily build and tests passed
if((Test-DailyBuild) -and $env:TestPassed -eq 'True')
{
Publish-NuGetFeed -OutputPath .\nuget-artifacts -ReleaseTag $preReleaseVersion
$nugetArtifacts = Get-ChildItem .\nuget-artifacts -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName }
if($nugetArtifacts)
{
$artifacts.AddRange($nugetArtifacts)
}
}

$nugetArtifacts = Get-ChildItem .\nuget-artifacts -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName }

if($nugetArtifacts)
if (Test-DailyBuild)
{
$artifacts.AddRange($nugetArtifacts)
# produce win-arm and win-arm64 packages if it is a daily build
Start-PSBuild -Runtime win-arm -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
$arm32Package = Start-PSPackage -Type zip -WindowsRuntime win-arm -ReleaseTag $releaseTag -SkipReleaseChecks
$artifacts.Add($arm32Package)

Start-PSBuild -Runtime win-arm64 -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
$arm64Package = Start-PSPackage -Type zip -WindowsRuntime win-arm64 -ReleaseTag $releaseTag -SkipReleaseChecks
$artifacts.Add($arm64Package)
}

$pushedAllArtifacts = $true
Expand Down
21 changes: 13 additions & 8 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Start-PSPackage {
[string[]]$Type,

# Generate windows downlevel package
[ValidateSet("win7-x86", "win7-x64")]
[ValidateSet("win7-x86", "win7-x64", "win-arm", "win-arm64")]
[ValidateScript({$Environment.IsWindows})]
[string] $WindowsRuntime,

Expand All @@ -34,8 +34,8 @@ function Start-PSPackage {
)

DynamicParam {
if ($Type -eq "zip") {
# Add a dynamic parameter '-IncludeSymbols' when the specified package type is 'zip'.
if ("zip" -eq $Type) {
# Add a dynamic parameter '-IncludeSymbols' when the specified package type is 'zip' only.
# The '-IncludeSymbols' parameter can be used to indicate that the package should only contain powershell binaries and symbols.
$ParameterAttr = New-Object "System.Management.Automation.ParameterAttribute"
$Attributes = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]"
Expand Down Expand Up @@ -65,21 +65,25 @@ function Start-PSPackage {
}

if($Environment.IsWindows) {
# Runtime will always be win7-x64 or win7-x86 on Windows.
# Runtime will be one of win7-x64, win7-x86, "win-arm" and "win-arm64" on Windows.
# Build the name suffix for universal win-plat packages.
$NameSuffix = $Runtime -replace 'win\d+', 'win'
switch ($Runtime) {
"win-arm" { $NameSuffix = "win-arm32" }
"win-arm64" { $NameSuffix = "win-arm64" }
default { $NameSuffix = $_ -replace 'win\d+', 'win' }
}
}

log "Packaging RID: '$Runtime'; Packaging Configuration: '$Configuration'"

$Script:Options = Get-PSOptions

$crossGenCorrect = $false
if ($Type -eq "tar-arm") {
# crossgen doesn't support arm32 yet
if ($Runtime -match "arm") {
# crossgen doesn't support arm32/64
$crossGenCorrect = $true
}
elseif($Script:Options.CrossGen) {
elseif ($Script:Options.CrossGen) {
$crossGenCorrect = $true
}

Expand All @@ -97,6 +101,7 @@ function Start-PSPackage {
# Make sure the most recent build satisfies the package requirement
if (-not $Script:Options -or ## Start-PSBuild hasn't been executed yet
-not $crossGenCorrect -or ## Last build didn't specify '-CrossGen' correctly
-not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly
$Script:Options.Runtime -ne $Runtime -or ## Last build wasn't for the required RID
$Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release'
$Script:Options.Framework -ne "netcoreapp2.0") ## Last build wasn't for CoreCLR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param (

[string] $destination = "$env:WORKSPACE",

[ValidateSet("win7-x64", "win7-x86")]
[ValidateSet("win7-x64", "win7-x86", "win-arm", "win-arm64")]
[string]$Runtime = 'win7-x64',

[switch] $Wait,
Expand Down Expand Up @@ -80,7 +80,7 @@ try{
else
{
Write-Verbose "Starting powershell build for RID: $Runtime and ReleaseTag: $ReleaseTag ..." -verbose
$buildParams = @{'CrossGen'=$true}
$buildParams = @{'CrossGen'= $Runtime -notmatch "arm"}
if(!$Symbols.IsPresent)
{
$buildParams['PSModuleRestore'] = $true
Expand All @@ -90,17 +90,14 @@ try{
}

$pspackageParams = @{'Type'='msi'; 'WindowsRuntime'=$Runtime}
if(!$Symbols.IsPresent)
if(!$Symbols.IsPresent -and $Runtime -notmatch "arm")
{
Write-Verbose "Starting powershell packaging(msi)..." -verbose
Start-PSPackage @pspackageParams @releaseTagParam
}
else
{
$pspackageParams += @{'IncludeSymbols' = $true}
}

$pspackageParams['Type']='zip'
$pspackageParams['IncludeSymbols']=$Symbols.IsPresent
Write-Verbose "Starting powershell packaging(zip)..." -verbose
Start-PSPackage @pspackageParams @releaseTagParam

Expand Down
82 changes: 78 additions & 4 deletions tools/releaseBuild/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"BinaryBucket": "release"
},
{
"Name": "win7-x64-symbols",
"Name": "win-x64-symbols",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x64 -ReleaseTag _ReleaseTag_ -Symbols",
"BuildDockerOptions": [
Expand All @@ -54,7 +54,7 @@
"VariableForExtractedBinariesPath": "Symbols_x64"
},
{
"Name": "win7-x86-symbols",
"Name": "win-x86-symbols",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x86 -ReleaseTag _ReleaseTag_ -Symbols",
"BuildDockerOptions": [
Expand All @@ -73,7 +73,45 @@
"VariableForExtractedBinariesPath": "Symbols_x86"
},
{
"Name": "win7-x64-package",
"Name": "win-arm-symbols",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win-arm -ReleaseTag _ReleaseTag_ -Symbols",
"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": "Symbols_arm"
},
{
"Name": "win-arm64-symbols",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win-arm64 -ReleaseTag _ReleaseTag_ -Symbols",
"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": "Symbols_arm64"
},
{
"Name": "win-x64-package",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x64 -ReleaseTag _ReleaseTag_",
"BuildDockerOptions": [
Expand All @@ -91,7 +129,7 @@
"ArtifactsExpected": 2
},
{
"Name": "win7-x86-package",
"Name": "win-x86-package",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win7-x86 -ReleaseTag _ReleaseTag_",
"BuildDockerOptions": [
Expand All @@ -107,6 +145,42 @@
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "signed",
"ArtifactsExpected": 2
},
{
"Name": "win-arm-package",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win-arm -ReleaseTag _ReleaseTag_",
"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": "signed",
"ArtifactsExpected": 1
},
{
"Name": "win-arm64-package",
"RepoDestinationPath": "C:\\PowerShell",
"BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime win-arm64 -ReleaseTag _ReleaseTag_",
"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": "signed",
"ArtifactsExpected": 1
}
],
"Linux": [
Expand Down