Skip to content

Commit 901bf01

Browse files
authored
[release/v7.6.2] Create PowerShell package for arm debian distribution (#27433)
1 parent 4aab623 commit 901bf01

5 files changed

Lines changed: 47 additions & 20 deletions

File tree

.pipelines/templates/linux-package-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
'tar' { 'Signed-linux-x64', 'powershell*.tar.gz' }
125125
'tar-alpine-fxdependent' { 'Signed-fxdependent-noopt-linux-musl-x64', 'powershell*.tar.gz' }
126126
'deb' { 'Signed-linux-x64', 'powershell*.deb' }
127+
'deb-arm64' { 'Signed-linux-arm64', 'powershell*.deb' }
127128
'rpm-fxdependent' { 'Signed-fxdependent-linux-x64', 'powershell*.rpm' }
128129
'rpm-fxdependent-arm64' { 'Signed-fxdependent-linux-arm64', 'powershell*.rpm' }
129130
'rpm' { 'Signed-linux-x64', 'powershell*.rpm' }

.pipelines/templates/release-validate-packagenames.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
- pwsh: |
110110
$message = @()
111111
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.deb | ForEach-Object {
112-
if($_.Name -notmatch 'powershell(-preview|-lts)?_\d+\.\d+\.\d+([\-~][a-z]*.\d+)?-\d\.deb_amd64\.deb')
112+
if($_.Name -notmatch 'powershell(-preview|-lts)?_\d+\.\d+\.\d+([\-~][a-z]*.\d+)?-\d\.deb_(amd64|arm64)\.deb')
113113
{
114114
$messageInstance = "$($_.Name) is not a valid package name"
115115
$message += $messageInstance

.pipelines/templates/stages/PowerShell-Packages-Stages.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ stages:
8787
packageType: deb
8888
jobName: deb
8989

90+
- template: /.pipelines/templates/linux-package-build.yml@self
91+
parameters:
92+
unsignedDrop: 'drop_linux_build_linux_arm64'
93+
signedDrop: 'drop_linux_sign_linux_arm64'
94+
packageType: deb-arm64
95+
jobName: deb_arm64
96+
9097
- template: /.pipelines/templates/linux-package-build.yml@self
9198
parameters:
9299
unsignedDrop: 'drop_linux_build_linux_fxd_x64_mariner'

test/packaging/linux/package-validation.tests.ps1

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ Describe "Linux Package Name Validation" {
99
} else {
1010
$env:SYSTEM_ARTIFACTSDIRECTORY
1111
}
12-
12+
1313
if (-not $artifactsDir) {
1414
throw "Artifacts directory not found. GITHUB_WORKSPACE or SYSTEM_ARTIFACTSDIRECTORY must be set."
1515
}
16-
16+
1717
Write-Verbose "Artifacts directory: $artifactsDir" -Verbose
1818
}
19-
19+
2020
Context "RPM Package Names" {
2121
It "Should have valid RPM package names" {
2222
$rpmPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.rpm -ErrorAction SilentlyContinue
23-
23+
2424
$rpmPackages.Count | Should -BeGreaterThan 0 -Because "At least one RPM package should exist in the artifacts directory"
25-
25+
2626
$invalidPackages = @()
2727
# Regex pattern for valid RPM package names.
2828
# Breakdown:
@@ -42,25 +42,26 @@ Describe "Linux Package Name Validation" {
4242
Write-Warning "$($package.Name) is not a valid RPM package name"
4343
}
4444
}
45-
45+
4646
if ($invalidPackages.Count -gt 0) {
4747
throw ($invalidPackages | Out-String)
4848
}
4949
}
5050
}
51-
51+
5252
Context "DEB Package Names" {
5353
It "Should have valid DEB package names" {
5454
$debPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.deb -ErrorAction SilentlyContinue
55-
55+
5656
$debPackages.Count | Should -BeGreaterThan 0 -Because "At least one DEB package should exist in the artifacts directory"
57-
57+
5858
$invalidPackages = @()
5959
# Regex pattern for valid DEB package names.
6060
# Valid examples:
6161
# - powershell-preview_7.6.0-preview.6-1.deb_amd64.deb
6262
# - powershell-lts_7.4.13-1.deb_amd64.deb
6363
# - powershell_7.4.13-1.deb_amd64.deb
64+
# - powershell_7.6.0-1.deb_arm64.deb
6465
# Breakdown:
6566
# ^powershell : Starts with 'powershell'
6667
# (-preview|-lts)? : Optionally '-preview' or '-lts'
@@ -78,19 +79,19 @@ Describe "Linux Package Name Validation" {
7879
Write-Warning "$($package.Name) is not a valid DEB package name"
7980
}
8081
}
81-
82+
8283
if ($invalidPackages.Count -gt 0) {
8384
throw ($invalidPackages | Out-String)
8485
}
8586
}
8687
}
87-
88+
8889
Context "Tar.Gz Package Names" {
8990
It "Should have valid tar.gz package names" {
9091
$tarPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.tar.gz -ErrorAction SilentlyContinue
91-
92+
9293
$tarPackages.Count | Should -BeGreaterThan 0 -Because "At least one tar.gz package should exist in the artifacts directory"
93-
94+
9495
$invalidPackages = @()
9596
foreach ($package in $tarPackages) {
9697
# Pattern matches: powershell-7.6.0-preview.6-linux-x64.tar.gz or powershell-7.6.0-linux-x64.tar.gz
@@ -100,17 +101,17 @@ Describe "Linux Package Name Validation" {
100101
Write-Warning "$($package.Name) is not a valid tar.gz package name"
101102
}
102103
}
103-
104+
104105
if ($invalidPackages.Count -gt 0) {
105106
throw ($invalidPackages | Out-String)
106107
}
107108
}
108109
}
109-
110+
110111
Context "Package Existence" {
111112
It "Should find at least one package in artifacts directory" {
112113
$allPackages = Get-ChildItem -Path $artifactsDir -Recurse -Include *.rpm, *.tar.gz, *.deb -ErrorAction SilentlyContinue
113-
114+
114115
$allPackages.Count | Should -BeGreaterThan 0 -Because "At least one package should exist in the artifacts directory"
115116
}
116117
}

tools/packaging/packaging.psm1

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function Start-PSPackage {
5252
[string]$Name = "powershell",
5353

5454
# Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported
55-
[ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-fxdependent-arm64", "msi", "zip", "zip-pdb", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size", "tar-alpine-fxdependent")]
55+
[ValidateSet("msix", "deb", "deb-arm64", "osxpkg", "rpm", "rpm-fxdependent", "rpm-fxdependent-arm64", "msi", "zip", "zip-pdb", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size", "tar-alpine-fxdependent")]
5656
[string[]]$Type,
5757

5858
# Generate windows downlevel package
@@ -641,6 +641,24 @@ function Start-PSPackage {
641641
}
642642
}
643643
}
644+
'deb-arm64' {
645+
$Arguments = @{
646+
Type = 'deb'
647+
PackageSourcePath = $Source
648+
Name = $Name
649+
Version = $Version
650+
Force = $Force
651+
NoSudo = $NoSudo
652+
LTS = $LTS
653+
HostArchitecture = "arm64"
654+
}
655+
foreach ($Distro in $Script:DebianDistributions) {
656+
$Arguments["Distribution"] = $Distro
657+
if ($PSCmdlet.ShouldProcess("Create DEB Package for $Distro")) {
658+
New-UnixPackage @Arguments
659+
}
660+
}
661+
}
644662
'rpm' {
645663
$Arguments = @{
646664
Type = 'rpm'
@@ -1060,7 +1078,7 @@ function New-UnixPackage {
10601078
# This is a string because strings are appended to it
10611079
[string]$Iteration = "1",
10621080

1063-
# Host architecture values allowed for deb type packages: amd64
1081+
# Host architecture values allowed for deb type packages: amd64, arm64
10641082
# Host architecture values allowed for rpm type packages include: x86_64, aarch64, native, all, noarch, any
10651083
# Host architecture values allowed for osxpkg type packages include: x86_64, arm64
10661084
[string]
@@ -5806,4 +5824,4 @@ function Test-IsProductFile {
58065824
}
58075825

58085826
return $false
5809-
}
5827+
}

0 commit comments

Comments
 (0)