Enable building of msix package (#9289) (#9715)

Add support in packaging.psm1 to produce a .msix AppX package.  Update the docker image to use the new msix package type.  Update the associated yml files so AzDevOps performs the build.

## PR Context

Enable publishing PSCore6 to Microsoft Store
This commit is contained in:
Travis Plunk
2019-05-23 16:28:06 -07:00
committed by GitHub
parent e61d43e600
commit f4aec00216
13 changed files with 99 additions and 23 deletions
+1
View File
@@ -34,6 +34,7 @@ dotnet-uninstall-debian-packages.sh
*.exe
*.msi
*.appx
*.msix
# Ignore binaries and symbols
*.pdb
+49
View File
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Package IgnorableNamespaces="uap mp rescap desktop6"
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
xmlns:desktop6="http://schemas.microsoft.com/appx/manifest/desktop/windows10/6"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
<Identity Name="Microsoft.PowerShell" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="$VERSION$" />
<Properties>
<DisplayName>PowerShell Core 6</DisplayName>
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
<Logo>assets\StoreLogo.png</Logo>
<desktop6:RegistryWriteVirtualization>disabled</desktop6:RegistryWriteVirtualization>
<desktop6:FileSystemWriteVirtualization>disabled</desktop6:FileSystemWriteVirtualization>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.17763.0" />
</Dependencies>
<Resources>
<Resource Language="en-US"/>
</Resources>
<Applications>
<Application Id="App" Executable="pwsh.exe" EntryPoint="Windows.FullTrustApplication">
<Extensions>
<uap3:Extension Category="windows.appExecutionAlias" EntryPoint="Windows.FullTrustApplication" Executable="pwsh.exe">
<uap3:AppExecutionAlias>
<desktop:ExecutionAlias Alias="pwsh.exe" />
</uap3:AppExecutionAlias>
</uap3:Extension>
</Extensions>
<uap:VisualElements DisplayName="PowerShell Core 6" Description="PowerShell is an automation and configuration management platform. It consists of a cross-platform (Windows, Linux, and macOS) command-line shell and associated scripting language." BackgroundColor="transparent" Square150x150Logo="assets\Square150x150Logo.png" Square44x44Logo="assets\Square44x44Logo.png">
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
<rescap:Capability Name="unvirtualizedResources" />
</Capabilities>
</Package>
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+6 -17
View File
@@ -2835,30 +2835,19 @@ function New-MSIXPackage
Set-Content -Path "$ProductSourcePath\AppxManifest.xml" -Value $appxManifest -Force
# Necessary image assets need to be in source assets folder
$assets = @(
'Square150x150Logo'
'Square44x44Logo'
'Square44x44Logo.targetsize-48'
'Square44x44Logo.targetsize-48_altform-unplated'
'StoreLogo'
'Square150x150Logo.png'
'Square44x44Logo.png'
'Square44x44Logo.targetsize-48.png'
'Square44x44Logo.targetsize-48_altform-unplated.png'
'StoreLogo.png'
)
if (!(Test-Path "$ProductSourcePath\assets")) {
$null = New-Item -ItemType Directory -Path "$ProductSourcePath\assets"
}
$isPreview = Test-IsPreview -Version $ProductSemanticVersion
if ($isPreview) {
Write-Verbose "Using Preview assets" -Verbose
}
$assets | ForEach-Object {
if ($isPreview) {
Copy-Item -Path "$RepoRoot\assets\$_-Preview.png" -Destination "$ProductSourcePath\assets\$_.png"
}
else {
Copy-Item -Path "$RepoRoot\assets\$_.png" -Destination "$ProductSourcePath\assets\"
}
Copy-Item -Path "$RepoRoot\assets\$_" -Destination "$ProductSourcePath\assets\"
}
if ($PSCmdlet.ShouldProcess("Create .msix package?")) {
@@ -19,6 +19,10 @@ COPY wix.psm1 containerFiles/wix.psm1
RUN Import-Module ./containerFiles/wix.psm1; `
Install-WixZip -zipPath \wix.Zip
# Install makeappx and makepri
ADD https://pscoretestdata.blob.core.windows.net/build-files/makeappx/makeappx.zip?sp=r&st=2019-04-05T18:02:52Z&se=2020-04-06T02:02:52Z&spr=https&sv=2018-03-28&sig=t07uC1K3uFLtINQsmorHobgPh%2B%2BBgjFnmHEJGNZT6Hk%3D&sr=b /makeappx.zip
RUN Expand-Archive /makeappx.zip
COPY PowerShellPackage.ps1 /
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
@@ -116,12 +116,19 @@ try{
$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 -ne 'fxdependent')
{
Write-Verbose "Starting powershell packaging(msi)..." -verbose
Start-PSPackage @pspackageParams @releaseTagParam
}
if (!$ComponentRegistration.IsPresent -and !$Symbols.IsPresent -and $Runtime -notin 'win7-x86','fxdependent')
{
$pspackageParams['Type']='msix'
Write-Verbose "Starting powershell packaging(msix)..." -verbose
Start-PSPackage @pspackageParams @releaseTagParam
}
if (!$ComponentRegistration.IsPresent -and $Runtime -ne 'fxdependent')
{
$pspackageParams['Type']='zip'
@@ -131,7 +138,7 @@ try{
Write-Verbose "Exporting packages ..." -verbose
Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb | ForEach-Object {
Get-ChildItem $location\*.msi,$location\*.zip,$location\*.wixpdb,$location\*.msix | ForEach-Object {
$file = $_.FullName
Write-Verbose "Copying $file to $destination" -verbose
Copy-Item -Path $file -Destination "$destination\" -Force
@@ -2,6 +2,7 @@ parameters:
architecture: x86
version: 6.2.0
msi: yes
msix: yes
steps:
- template: upload-final-results.yml
@@ -34,3 +35,19 @@ steps:
storage: '$(StorageAccount)'
ContainerName: '$(AzureVersion)'
condition: and(succeeded(), eq(variables['Build.Reason'], 'Manual'))
- template: upload-final-results.yml
parameters:
artifactPath: $(Build.StagingDirectory)\signedPackages
artifactFilter: PowerShell-${{ parameters.version }}-win-${{ parameters.architecture }}.msix
condition: and(succeeded(), eq('${{ parameters.msix }}', 'yes'))
- task: AzureFileCopy@1
displayName: 'upload signed msix to Azure - ${{ parameters.architecture }}'
inputs:
SourcePath: '$(Build.StagingDirectory)\signedPackages\PowerShell-${{ parameters.version }}-win-${{ parameters.architecture }}.msix'
azureSubscription: '$(AzureFileCopySubscription)'
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: '$(AzureVersion)'
condition: and(succeeded(), eq('${{ parameters.msix }}', 'yes'), eq(variables['Build.Reason'], 'Manual'))
@@ -34,7 +34,14 @@ jobs:
continueOnError: true
- powershell: |
tools/releaseBuild/generatePackgeSigning.ps1 -AuthenticodeFiles "$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x64.msi","$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x86.msi" -path "$(System.ArtifactsDirectory)\package.xml"
$authenticodefiles = @(
"$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x64.msi"
"$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x86.msi"
"$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-x64.msix"
"$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-arm32.msix"
"$(System.ArtifactsDirectory)\signed\PowerShell-$(Version)-win-arm64.msix"
)
tools/releaseBuild/generatePackgeSigning.ps1 -AuthenticodeFiles $authenticodeFiles -path "$(System.ArtifactsDirectory)\package.xml"
displayName: 'Generate Package Signing Xml'
- powershell: |
@@ -56,6 +63,7 @@ jobs:
parameters:
architecture: x86
version: $(version)
msix: no
- template: upload.yml
parameters:
@@ -79,6 +87,7 @@ jobs:
architecture: fxdependent
version: $(version)
msi: no
msix: no
- task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3
displayName: 'Run Defender Scan'
+3 -3
View File
@@ -152,7 +152,7 @@
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "signed",
"ArtifactsExpected": 3,
"ArtifactsExpected": 4,
"EnableFeature": [ "ArtifactAsFolder" ]
},
{
@@ -190,7 +190,7 @@
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "signed",
"ArtifactsExpected": 1,
"ArtifactsExpected": 2,
"EnableFeature": [ "ArtifactAsFolder" ]
},
{
@@ -209,7 +209,7 @@
],
"DockerImageName": "ps-winsrvcore",
"BinaryBucket": "signed",
"ArtifactsExpected": 1,
"ArtifactsExpected": 2,
"EnableFeature": [ "ArtifactAsFolder" ]
},
{