diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index aae4c4510e2..7e256db8111 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -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' @@ -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 @@ -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 diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 080617ae9e3..35f3839e2fe 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -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, @@ -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]" @@ -65,9 +65,13 @@ 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'" @@ -75,11 +79,11 @@ function Start-PSPackage { $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 } @@ -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 diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index 1b3e0688aba..5db03c7eb4a 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -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, @@ -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 @@ -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 diff --git a/tools/releaseBuild/build.json b/tools/releaseBuild/build.json index a7ee5c9fd3d..ee8e86840f9 100644 --- a/tools/releaseBuild/build.json +++ b/tools/releaseBuild/build.json @@ -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": [ @@ -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": [ @@ -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": [ @@ -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": [ @@ -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": [