From 540737ebe1eae53fd60c6dcc5a76fe9e8b814ab9 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 12 Jul 2019 17:18:11 -0700 Subject: [PATCH] Split the fxdependent package on Windows into two packages (#10134) --- build.psm1 | 88 +++++++++++++------ ...icrosoft.PowerShell.GlobalTool.Shim.csproj | 8 +- .../powershell-win-core.csproj | 8 +- tools/packaging/packaging.psm1 | 32 ++++--- .../PowerShellPackage.ps1 | 18 ++-- .../releaseBuild/azureDevOps/releaseBuild.yml | 7 ++ .../azureDevOps/templates/nuget.yml | 12 ++- .../azureDevOps/templates/windows-build.yml | 29 +----- .../templates/windows-package-signing.yml | 7 ++ tools/releaseBuild/build.json | 39 ++++++++ 10 files changed, 169 insertions(+), 79 deletions(-) diff --git a/build.psm1 b/build.psm1 index e590ecb4fdff..bc99873871fc 100644 --- a/build.psm1 +++ b/build.psm1 @@ -220,6 +220,7 @@ function Start-PSBuild { # If this parameter is not provided it will get determined automatically. [ValidateSet("alpine-x64", "fxdependent", + "fxdependent-win-desktop", "linux-arm", "linux-arm64", "linux-x64", @@ -328,7 +329,7 @@ Fix steps: $Arguments += "--output", (Split-Path $Options.Output) } - if ($Options.Runtime -like 'win*' -or ($Options.Runtime -eq 'fxdependent' -and $Environment.IsWindows)) { + if ($Options.Runtime -like 'win*' -or ($Options.Runtime -like 'fxdependent*' -and $Environment.IsWindows)) { $Arguments += "/property:IsWindows=true" } else { @@ -380,30 +381,50 @@ Fix steps: } try { - # Relative paths do not work well if cwd is not changed to project - Push-Location $Options.Top - Write-Log "Run dotnet $Arguments from $pwd" - Start-NativeExecution { dotnet $Arguments } - - if ($CrossGen -and $Options.Runtime -ne 'fxdependent') { - ## fxdependent package cannot be CrossGen'ed - Start-CrossGen -PublishPath $publishPath -Runtime $script:Options.Runtime - Write-Log "pwsh.exe with ngen binaries is available at: $($Options.Output)" - } else { + + if ($Options.Runtime -notlike 'fxdependent*') { + # Relative paths do not work well if cwd is not changed to project + Push-Location $Options.Top + + if ($Options.Runtime -like 'win-arm*') { + $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk" + } else { + $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" + } + + Write-Log "Run dotnet $Arguments from $pwd" + Start-NativeExecution { dotnet $Arguments } Write-Log "PowerShell output: $($Options.Output)" + if ($CrossGen) { + ## fxdependent package cannot be CrossGen'ed + Start-CrossGen -PublishPath $publishPath -Runtime $script:Options.Runtime + Write-Log "pwsh.exe with ngen binaries is available at: $($Options.Output)" + } + + } else { + $globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path + if ($Options.Runtime -eq 'fxdependent') { - $globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path + $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk" + } elseif ($Options.Runtime -eq 'fxdependent-win-desktop') { + $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" + } - try { - Push-Location $globalToolSrcFolder - $Arguments += "--output", $publishPath - Write-Log "Run dotnet $Arguments from $pwd to build global tool entry point" - Start-NativeExecution { dotnet $Arguments } - } - finally { - Pop-Location - } + # Relative paths do not work well if cwd is not changed to project + Push-Location $Options.Top + Write-Log "Run dotnet $Arguments from $pwd" + Start-NativeExecution { dotnet $Arguments } + Write-Log "PowerShell output: $($Options.Output)" + + try { + Push-Location $globalToolSrcFolder + $Arguments += "--output", $publishPath + Write-Log "Run dotnet $Arguments from $pwd to build global tool entry point" + Start-NativeExecution { dotnet $Arguments } + } + finally { + Pop-Location } } } finally { @@ -479,17 +500,27 @@ function Restore-PSPackage { $ProjectDirs = @($Options.Top, "$PSScriptRoot/src/TypeCatalogGen", "$PSScriptRoot/src/ResGen", "$PSScriptRoot/src/Modules") - if ($Options.Runtime -eq 'fxdependent') { + if ($Options.Runtime -like 'fxdependent*') { $ProjectDirs += "$PSScriptRoot/src/Microsoft.PowerShell.GlobalTool.Shim" } } if ($Force -or (-not (Test-Path "$($Options.Top)/obj/project.assets.json"))) { - if($Options.Runtime -ne 'fxdependent') { - $RestoreArguments = @("--runtime",$Options.Runtime, "--verbosity") + $sdkToUse = if (($Options.Runtime -eq 'fxdependent-win-desktop' -or $Options.Runtime -like 'win*')) { # this is fxd or some windows runtime + if ($Options.Runtime -like 'win-arm*') { + 'Microsoft.NET.Sdk' + } else { + 'Microsoft.NET.Sdk.WindowsDesktop' + } + } else { + 'Microsoft.NET.Sdk' + } + + if ($Options.Runtime -notlike 'fxdependent*') { + $RestoreArguments = @("--runtime", $Options.Runtime, "/property:SDKToUse=$sdkToUse", "--verbosity") } else { - $RestoreArguments = @("--verbosity") + $RestoreArguments = @("/property:SDKToUse=$sdkToUse", "--verbosity") } if ($PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent) { @@ -580,6 +611,7 @@ function New-PSOptions { [ValidateSet("", "alpine-x64", "fxdependent", + "fxdependent-win-desktop", "linux-arm", "linux-arm64", "linux-x64", @@ -638,7 +670,7 @@ function New-PSOptions { } } - $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -eq 'fxdependent' -and $Environment.IsWindows)) { + $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $Environment.IsWindows)) { "powershell-win-core" } else { "powershell-unix" @@ -652,7 +684,7 @@ function New-PSOptions { Write-Verbose "Using framework '$Framework'" } - $Executable = if ($Runtime -eq 'fxdependent') { + $Executable = if ($Runtime -like 'fxdependent*') { "pwsh.dll" } elseif ($Environment.IsLinux -or $Environment.IsMacOS) { "pwsh" @@ -662,7 +694,7 @@ function New-PSOptions { # Build the Output path if (!$Output) { - if ($Runtime -eq 'fxdependent') { + if ($Runtime -like 'fxdependent*') { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, "publish", $Executable) } else { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, "publish", $Executable) diff --git a/src/Microsoft.PowerShell.GlobalTool.Shim/Microsoft.PowerShell.GlobalTool.Shim.csproj b/src/Microsoft.PowerShell.GlobalTool.Shim/Microsoft.PowerShell.GlobalTool.Shim.csproj index c8d2b253e538..aa845a7817d4 100644 --- a/src/Microsoft.PowerShell.GlobalTool.Shim/Microsoft.PowerShell.GlobalTool.Shim.csproj +++ b/src/Microsoft.PowerShell.GlobalTool.Shim/Microsoft.PowerShell.GlobalTool.Shim.csproj @@ -1,4 +1,4 @@ - + @@ -8,4 +8,10 @@ Microsoft.PowerShell.GlobalTool.Shim + + + + + + diff --git a/src/powershell-win-core/powershell-win-core.csproj b/src/powershell-win-core/powershell-win-core.csproj index 31bf3d1106d1..f267a09816ef 100644 --- a/src/powershell-win-core/powershell-win-core.csproj +++ b/src/powershell-win-core/powershell-win-core.csproj @@ -12,11 +12,11 @@ ..\..\assets\pwsh.manifest - - + + - - + + diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 30eaea4c834b..579061cbb792 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -25,7 +25,7 @@ function Start-PSPackage { [string]$Name = "powershell", # Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported - [ValidateSet("msix", "deb", "osxpkg", "rpm", "msi", "zip", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent")] + [ValidateSet("msix", "deb", "osxpkg", "rpm", "msi", "zip", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop")] [string[]]$Type, # Generate windows downlevel package @@ -41,7 +41,7 @@ function Start-PSPackage { ) DynamicParam { - if ("zip" -eq $Type -or "fxdependent" -eq $Type) { + if ("zip" -eq $Type -or "fxdependent" -eq $Type -or "fxdependent-win-desktop" -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" @@ -88,6 +88,9 @@ function Start-PSPackage { if ($Type -eq 'fxdependent') { $NameSuffix = "win-fxdependent" Write-Log "Packaging : '$Type'; Packaging Configuration: '$Configuration'" + } elseif ($Type -eq 'fxdependent-win-desktop') { + $NameSuffix = "win-fxdependentWinDesktop" + Write-Log "Packaging : '$Type'; Packaging Configuration: '$Configuration'" } else { Write-Log "Packaging RID: '$Runtime'; Packaging Configuration: '$Configuration'" } @@ -120,7 +123,7 @@ function Start-PSPackage { $actualParams += '-PSModuleRestore' } - $precheckFailed = if ($Type -eq 'fxdependent' -or $Type -eq 'tar-alpine') { + $precheckFailed = if ($Type -like 'fxdependent*' -or $Type -eq 'tar-alpine') { ## We do not check for runtime and crossgen for framework dependent package. -not $Script:Options -or ## Start-PSBuild hasn't been executed yet -not $PSModuleRestoreCorrect -or ## Last build didn't specify '-PSModuleRestore' correctly @@ -152,7 +155,7 @@ function Start-PSPackage { $params = @('-Clean') # CrossGen cannot be done for framework dependent package as it is runtime agnostic. - if ($Type -ne 'fxdependent') { + if ($Type -notlike 'fxdependent*') { $params += '-CrossGen' } @@ -164,6 +167,8 @@ function Start-PSPackage { if ($Type -eq 'fxdependent') { $params += '-Runtime', 'fxdependent' + } elseif ($Type -eq 'fxdependent-win-desktop') { + $params += '-Runtime', 'fxdependent-win-desktop' } else { $params += '-Runtime', $Runtime } @@ -282,7 +287,8 @@ function Start-PSPackage { New-ZipPackage @Arguments } } - "fxdependent" { + + { $_ -like "fxdependent*" } { ## Remove PDBs from package to reduce size. if(-not $IncludeSymbols.IsPresent) { Get-ChildItem $Source -Filter *.pdb | Remove-Item -Force @@ -3230,6 +3236,7 @@ function New-GlobalToolNupkg param( [Parameter(Mandatory)] [string] $LinuxBinPath, [Parameter(Mandatory)] [string] $WindowsBinPath, + [Parameter(Mandatory)] [string] $WindowsDesktopBinPath, [Parameter(Mandatory)] [string] $PackageVersion, [Parameter(Mandatory)] [string] $DestinationPath, [Parameter(ParameterSetName="UnifiedPackage")] [switch] $UnifiedPackage @@ -3241,13 +3248,13 @@ function New-GlobalToolNupkg Remove-Item -Path (Join-Path $LinuxBinPath 'libssl.so.1.0.0') -Verbose -Force -Recurse ## Remove unnecessary xml files - Get-ChildItem -Path $LinuxBinPath, $WindowsBinPath -Filter *.xml | Remove-Item -Verbose + Get-ChildItem -Path $LinuxBinPath, $WindowsBinPath, $WindowsDesktopBinPath -Filter *.xml | Remove-Item -Verbose if ($UnifiedPackage) { Write-Log "Creating a unified package" $packageInfo += @{ RootFolder = (New-TempFolder); PackageName = "PowerShell"; Type = "Unified"} - $ShimDllPath = Join-Path $WindowsBinPath "Microsoft.PowerShell.GlobalTool.Shim.dll" + $ShimDllPath = Join-Path $WindowsDesktopBinPath "Microsoft.PowerShell.GlobalTool.Shim.dll" } else { @@ -3257,6 +3264,9 @@ function New-GlobalToolNupkg Write-Log "Reducing size of Windows package" ReduceFxDependentPackage -Path $WindowsBinPath -KeepWindowsRuntimes + Write-Log "Reducing size of WindowsDesktop package" + ReduceFxDependentPackage -Path $WindowsDesktopBinPath -KeepWindowsRuntimes + Write-Log "Creating a Linux and Windows packages" $packageInfo += @{ RootFolder = (New-TempFolder); PackageName = "PowerShell.Linux.Alpine"; Type = "PowerShell.Linux.Alpine"} $packageInfo += @{ RootFolder = (New-TempFolder); PackageName = "PowerShell.Linux.x64"; Type = "PowerShell.Linux.x64"} @@ -3279,8 +3289,8 @@ function New-GlobalToolNupkg $winFolder = New-Item (Join-Path $ridFolder "win") -ItemType Directory $unixFolder = New-Item (Join-Path $ridFolder "unix") -ItemType Directory - Write-Log "Copying runtime assemblies from $WindowsBinPath" - Copy-Item "$WindowsBinPath\*" -Destination $winFolder -Recurse + Write-Log "Copying runtime assemblies from $WindowsDesktopBinPath" + Copy-Item "$WindowsDesktopBinPath\*" -Destination $winFolder -Recurse Write-Log "Copying runtime assemblies from $LinuxBinPath" Copy-Item "$LinuxBinPath\*" -Destination $unixFolder -Recurse @@ -3341,8 +3351,8 @@ function New-GlobalToolNupkg "PowerShell.Windows.x64" { - Write-Log "Copying runtime assemblies from $WindowsBinPath for $packageType" - Copy-Item "$WindowsBinPath/*" -Destination $ridFolder -Recurse + Write-Log "Copying runtime assemblies from $WindowsDesktopBinPath for $packageType" + Copy-Item "$WindowsDesktopBinPath/*" -Destination $ridFolder -Recurse Remove-Item -Path $ridFolder/runtimes/win-arm -Recurse -Force $toolSettings = $packagingStrings.GlobalToolSettingsFile -f "pwsh.dll" } diff --git a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 index ffa5832c1103..f6e2ae92d4e3 100644 --- a/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/microsoft_powershell_windowsservercore/PowerShellPackage.ps1 @@ -11,7 +11,7 @@ param ( [string] $destination = "$env:WORKSPACE", - [ValidateSet("win7-x64", "win7-x86", "win-arm", "win-arm64", "fxdependent")] + [ValidateSet("win7-x64", "win7-x86", "win-arm", "win-arm64", "fxdependent", "fxdependent-win-desktop")] [string]$Runtime = 'win7-x64', [switch] $Wait, @@ -79,7 +79,7 @@ try{ if ($PSCmdlet.ParameterSetName -eq 'packageSigned') { Write-Verbose "Expanding signed build..." -verbose - if($Runtime -eq 'fxdependent') + if($Runtime -like 'fxdependent*') { Expand-PSSignedBuild -BuildZip $BuildZip -SkipPwshExeCheck } @@ -93,7 +93,7 @@ try{ else { Write-Verbose "Starting powershell build for RID: $Runtime and ReleaseTag: $ReleaseTag ..." -verbose - $buildParams = @{'CrossGen'= $Runtime -notmatch "arm" -and $Runtime -ne "fxdependent"} + $buildParams = @{'CrossGen'= $Runtime -notmatch "arm" -and $Runtime -notlike "fxdependent*"} if($Symbols.IsPresent) { @@ -111,25 +111,29 @@ try{ { $pspackageParams = @{'Type'='fxdependent'} } + elseif ($Runtime -eq 'fxdependent-win-desktop') + { + $pspackageParams = @{'Type'='fxdependent-win-desktop'} + } else { $pspackageParams = @{'Type'='msi'; 'WindowsRuntime'=$Runtime} } - if (!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notmatch 'arm' -and $Runtime -ne 'fxdependent') + if (!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notmatch 'arm' -and $Runtime -notlike 'fxdependent*') { Write-Verbose "Starting powershell packaging(msi)..." -verbose Start-PSPackage @pspackageParams @releaseTagParam } - if (!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notin 'win7-x86','fxdependent') + if (!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notin 'win7-x86','fxdependent', 'fxdependent-win-desktop') { $pspackageParams['Type']='msix' Write-Verbose "Starting powershell packaging(msix)..." -verbose Start-PSPackage @pspackageParams @releaseTagParam } - if (!$ComponentRegistration.IsPresent -and $Runtime -ne 'fxdependent') + if (!$ComponentRegistration.IsPresent -and $Runtime -notlike 'fxdependent*') { $pspackageParams['Type']='zip' $pspackageParams['IncludeSymbols']=$Symbols.IsPresent @@ -144,7 +148,7 @@ try{ Copy-Item -Path $file -Destination "$destination\" -Force } } - elseif (!$ComponentRegistration.IsPresent -and $Runtime -eq 'fxdependent') + elseif (!$ComponentRegistration.IsPresent -and $Runtime -like 'fxdependent*') { ## Add symbols for just like zip package. $pspackageParams['IncludeSymbols']=$Symbols.IsPresent diff --git a/tools/releaseBuild/azureDevOps/releaseBuild.yml b/tools/releaseBuild/azureDevOps/releaseBuild.yml index 8281ec8eef41..9ea0a6894b3b 100644 --- a/tools/releaseBuild/azureDevOps/releaseBuild.yml +++ b/tools/releaseBuild/azureDevOps/releaseBuild.yml @@ -59,6 +59,11 @@ jobs: parameters: Architecture: fxdependent +- template: templates/windows-build.yml + parameters: + Architecture: fxdependentWinDesktop + + - template: templates/windows-component-governance.yml - template: templates/windows-package-signing.yml @@ -69,6 +74,7 @@ jobs: - build_windows_arm - build_windows_arm64 - build_windows_fxdependent + - build_windows_fxdependentWinDesktop - template: templates/mac-package-signing.yml @@ -78,6 +84,7 @@ jobs: - build_windows_x64 - build_windows_x86 - build_windows_fxdependent + - build_windows_fxdependentWinDesktop - template: templates/nuget.yml parameters: diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index 458f69253322..2f253b51f0f1 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -15,6 +15,7 @@ jobs: GenAPIToolPath: '$(System.ArtifactsDirectory)/GenAPI' PackagePath: '$(System.ArtifactsDirectory)/UnifiedPackagePath' winFxdPath: '$(System.ArtifactsDirectory)/winFxd' + winFxdWinDesktopPath: '$(System.ArtifactsDirectory)/winFxdWinDesktop' linuxFxdPath: '$(System.ArtifactsDirectory)/linuxFxd' steps: @@ -56,6 +57,12 @@ jobs: archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/PowerShell-*-win-fxdependent.zip' destinationFolder: '$(winFxdPath)' + - task: ExtractFiles@1 + displayName: 'Extract files win-fxdependentWinDesktop' + inputs: + archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/PowerShell-*-win-fxdependentWinDesktop.zip' + destinationFolder: '$(winFxdWinDesktopPath)' + - task: ExtractFiles@1 displayName: 'Extract files linux-fxdependent' inputs: @@ -88,6 +95,7 @@ jobs: - powershell: | Get-ChildItem $(linuxFxdPath) Get-ChildItem $(winFxdPath) + Get-ChildItem $(winFxdWinDesktopPath) displayName: Capture fxd folders - powershell: | @@ -95,10 +103,10 @@ jobs: Import-Module $env:BUILD_SOURCESDIRECTORY\tools\packaging # Create unified package first - New-GlobalToolNupkg -UnifiedPackage -LinuxBinPath "$(linuxFxdPath)" -WindowsBinPath "$(winFxdPath)" -PackageVersion "$(Version)" -DestinationPath "$(PackagePath)\globaltool" + New-GlobalToolNupkg -UnifiedPackage -LinuxBinPath "$(linuxFxdPath)" -WindowsBinPath "$(winFxdPath)" -WindowsDesktopBinPath "$(winFxdWinDesktopPath)" -PackageVersion "$(Version)" -DestinationPath "$(PackagePath)\globaltool" # Create packages for dotnet sdk - New-GlobalToolNupkg -LinuxBinPath "$(linuxFxdPath)" -WindowsBinPath "$(winFxdPath)" -PackageVersion "$(Version)" -DestinationPath "$(PackagePath)\globaltool" + New-GlobalToolNupkg -LinuxBinPath "$(linuxFxdPath)" -WindowsBinPath "$(winFxdPath)" -WindowsDesktopBinPath "$(winFxdWinDesktopPath)" -PackageVersion "$(Version)" -DestinationPath "$(PackagePath)\globaltool" displayName: 'Create Global tool packages' - powershell: | diff --git a/tools/releaseBuild/azureDevOps/templates/windows-build.yml b/tools/releaseBuild/azureDevOps/templates/windows-build.yml index e7a0e728adca..b38494a50574 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-build.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-build.yml @@ -37,22 +37,6 @@ jobs: parameters: ReleaseTagVar: $(ReleaseTagVar) - - powershell: | - Write-Verbose -Verbose "$(Architecture)" - - if ('$(Architecture)' -eq 'fxdependent' -and '$(ReleaseTagVar)' -match '6.0.*') - { - $vstsCommandString = "vso[task.setvariable variable=SkipFxDependent]true" - } - else - { - $vstsCommandString = "vso[task.setvariable variable=SkipFxDependent]false" - } - - Write-Verbose -Message "$vstsCommandString " -Verbose - Write-Host -Object "##$vstsCommandString" - displayName: 'Skip FxDependent for PS v6.0.*' - - template: insert-nuget-config-azfeed.yml - powershell: | @@ -61,7 +45,6 @@ jobs: displayName: 'Remove all containers [Port to PSRelease]' # Cleanup is not critical it passes every time it runs continueOnError: true - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - powershell: | docker image ls --format '{{ json .}}'|ConvertFrom-Json| ForEach-Object { @@ -80,7 +63,6 @@ jobs: displayName: 'Remove old images [Port to PSRelease]' # Cleanup is not critical it passes every time it runs continueOnError: true - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - powershell: | Write-verbose "--docker info---" -verbose @@ -93,15 +75,13 @@ jobs: displayName: 'Capture docker info' # Diagnostics is not critical it passes every time it runs continueOnError: true - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - powershell: | tools/releaseBuild/vstsbuild.ps1 -ReleaseTag $(ReleaseTagVar) -Name win-$(Architecture)-symbols displayName: 'Build Windows Universal - $(Architecture) Symbols zip' - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - powershell: | - if ("$env:Architecture" -eq 'fxdependent') + if ("$env:Architecture" -like 'fxdependent*') { $(Build.SourcesDirectory)\tools\releaseBuild\updateSigning.ps1 -SkipPwshExe } @@ -110,14 +90,12 @@ jobs: $(Build.SourcesDirectory)\tools\releaseBuild\updateSigning.ps1 } displayName: 'Update Signing Xml' - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - powershell: | $vstsCommandString = "vso[task.setvariable variable=Symbols]${env:Symbols_$(Architecture)}" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" displayName: 'Get Symbols path [Update build.json]' - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - task: PkgESCodeSign@10 displayName: 'CodeSign $(Architecture)' @@ -129,17 +107,16 @@ jobs: outPathRoot: '$(Symbols)\signed' binVersion: $(SigingVersion) binVersionOverride: $(SigningVersionOverride) - condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'), ne(variables['SkipFxDependent'], 'true')) + condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual')) - powershell: | New-Item -ItemType Directory -Path $(Symbols)\signed -Force displayName: 'Create empty signed folder' - condition: and(succeeded(), ne(variables['Build.Reason'], 'Manual'), ne(variables['SkipFxDependent'], 'true')) + condition: and(succeeded(), ne(variables['Build.Reason'], 'Manual')) - powershell: | tools/releaseBuild/vstsbuild.ps1 -ReleaseTag $(ReleaseTagVar) -Name win-$(Architecture)-package -BuildPath $(Symbols) -SignedFilesPath $(Symbols)\signed displayName: 'Build Windows Universal - $(Architecture) Package' - condition: and(succeeded(), ne(variables['SkipFxDependent'], 'true')) - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Detection' diff --git a/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml b/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml index da05a52d049b..349a29e3789f 100644 --- a/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml +++ b/tools/releaseBuild/azureDevOps/templates/windows-package-signing.yml @@ -89,6 +89,13 @@ jobs: msi: no msix: no + - template: upload.yml + parameters: + architecture: fxdependentWinDesktop + version: $(version) + msi: no + msix: no + - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3 displayName: 'Run Defender Scan' diff --git a/tools/releaseBuild/build.json b/tools/releaseBuild/build.json index a2a31c5bf385..38b99afe8456 100644 --- a/tools/releaseBuild/build.json +++ b/tools/releaseBuild/build.json @@ -250,6 +250,45 @@ "BinaryBucket": "signed", "ArtifactsExpected": 1, "EnableFeature": [ "ArtifactAsFolder" ] + }, + { + "Name": "win-fxdependentWinDesktop-symbols", + "RepoDestinationPath": "C:\\PowerShell", + "BuildCommand": "C:\\PowerShellPackage.ps1 -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime fxdependent-win-desktop -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_fxdependentWinDesktop", + "EnableFeature": [ "ArtifactAsFolder" ] + }, + { + "Name": "win-fxdependentWinDesktop-package", + "RepoDestinationPath": "C:\\PowerShell", + "BuildCommand": "C:\\PowerShellPackage.ps1 -BuildZip _RepoDestinationPath_\\_BuildPackageName_ -location _RepoDestinationPath_ -destination _DockerVolume_ -Runtime fxdependent-win-desktop -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, + "EnableFeature": [ "ArtifactAsFolder" ] } ], "Linux": [