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
1 change: 1 addition & 0 deletions .pipelines/templates/linux-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ jobs:
'tar' { 'Signed-linux-x64', 'powershell*.tar.gz' }
'tar-alpine-fxdependent' { 'Signed-fxdependent-noopt-linux-musl-x64', 'powershell*.tar.gz' }
'deb' { 'Signed-linux-x64', 'powershell*.deb' }
'deb-arm64' { 'Signed-linux-arm64', 'powershell*.deb' }
'rpm-fxdependent' { 'Signed-fxdependent-linux-x64', 'powershell*.rpm' }
'rpm-fxdependent-arm64' { 'Signed-fxdependent-linux-arm64', 'powershell*.rpm' }
'rpm' { 'Signed-linux-x64', 'powershell*.rpm' }
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/release-validate-packagenames.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
- pwsh: |
$message = @()
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.deb | ForEach-Object {
if($_.Name -notmatch 'powershell(-preview|-lts)?_\d+\.\d+\.\d+([\-~][a-z]*.\d+)?-\d\.deb_amd64\.deb')
if($_.Name -notmatch 'powershell(-preview|-lts)?_\d+\.\d+\.\d+([\-~][a-z]*.\d+)?-\d\.deb_(amd64|arm64)\.deb')
{
$messageInstance = "$($_.Name) is not a valid package name"
$message += $messageInstance
Expand Down
7 changes: 7 additions & 0 deletions .pipelines/templates/stages/PowerShell-Packages-Stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ stages:
packageType: deb
jobName: deb

- template: /.pipelines/templates/linux-package-build.yml@self
parameters:
unsignedDrop: 'drop_linux_build_linux_arm64'
signedDrop: 'drop_linux_sign_linux_arm64'
packageType: deb-arm64
jobName: deb_arm64

- template: /.pipelines/templates/linux-package-build.yml@self
parameters:
unsignedDrop: 'drop_linux_build_linux_fxd_x64_mariner'
Expand Down
33 changes: 17 additions & 16 deletions test/packaging/linux/package-validation.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Describe "Linux Package Name Validation" {
} else {
$env:SYSTEM_ARTIFACTSDIRECTORY
}

if (-not $artifactsDir) {
throw "Artifacts directory not found. GITHUB_WORKSPACE or SYSTEM_ARTIFACTSDIRECTORY must be set."
}

Write-Verbose "Artifacts directory: $artifactsDir" -Verbose
}

Context "RPM Package Names" {
It "Should have valid RPM package names" {
$rpmPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.rpm -ErrorAction SilentlyContinue

$rpmPackages.Count | Should -BeGreaterThan 0 -Because "At least one RPM package should exist in the artifacts directory"

$invalidPackages = @()
# Regex pattern for valid RPM package names.
# Breakdown:
Expand All @@ -42,25 +42,26 @@ Describe "Linux Package Name Validation" {
Write-Warning "$($package.Name) is not a valid RPM package name"
}
}

if ($invalidPackages.Count -gt 0) {
throw ($invalidPackages | Out-String)
}
}
}

Context "DEB Package Names" {
It "Should have valid DEB package names" {
$debPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.deb -ErrorAction SilentlyContinue

$debPackages.Count | Should -BeGreaterThan 0 -Because "At least one DEB package should exist in the artifacts directory"

$invalidPackages = @()
# Regex pattern for valid DEB package names.
# Valid examples:
# - powershell-preview_7.6.0-preview.6-1.deb_amd64.deb
# - powershell-lts_7.4.13-1.deb_amd64.deb
# - powershell_7.4.13-1.deb_amd64.deb
# - powershell_7.6.0-1.deb_arm64.deb
# Breakdown:
# ^powershell : Starts with 'powershell'
# (-preview|-lts)? : Optionally '-preview' or '-lts'
Expand All @@ -78,19 +79,19 @@ Describe "Linux Package Name Validation" {
Write-Warning "$($package.Name) is not a valid DEB package name"
}
}

if ($invalidPackages.Count -gt 0) {
throw ($invalidPackages | Out-String)
}
}
}

Context "Tar.Gz Package Names" {
It "Should have valid tar.gz package names" {
$tarPackages = Get-ChildItem -Path $artifactsDir -Recurse -Filter *.tar.gz -ErrorAction SilentlyContinue

$tarPackages.Count | Should -BeGreaterThan 0 -Because "At least one tar.gz package should exist in the artifacts directory"

$invalidPackages = @()
foreach ($package in $tarPackages) {
# Pattern matches: powershell-7.6.0-preview.6-linux-x64.tar.gz or powershell-7.6.0-linux-x64.tar.gz
Expand All @@ -100,17 +101,17 @@ Describe "Linux Package Name Validation" {
Write-Warning "$($package.Name) is not a valid tar.gz package name"
}
}

if ($invalidPackages.Count -gt 0) {
throw ($invalidPackages | Out-String)
}
}
}

Context "Package Existence" {
It "Should find at least one package in artifacts directory" {
$allPackages = Get-ChildItem -Path $artifactsDir -Recurse -Include *.rpm, *.tar.gz, *.deb -ErrorAction SilentlyContinue

$allPackages.Count | Should -BeGreaterThan 0 -Because "At least one package should exist in the artifacts directory"
}
}
Expand Down
22 changes: 20 additions & 2 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Start-PSPackage {
[string]$Name = "powershell",

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

# Generate windows downlevel package
Expand Down Expand Up @@ -613,6 +613,24 @@ function Start-PSPackage {
}
}
}
'deb-arm64' {
$Arguments = @{
Type = 'deb'
PackageSourcePath = $Source
Name = $Name
Version = $Version
Force = $Force
NoSudo = $NoSudo
LTS = $LTS
HostArchitecture = "arm64"
}
foreach ($Distro in $Script:DebianDistributions) {
$Arguments["Distribution"] = $Distro
if ($PSCmdlet.ShouldProcess("Create DEB Package for $Distro")) {
New-UnixPackage @Arguments
}
}
}
'rpm' {
$Arguments = @{
Type = 'rpm'
Expand Down Expand Up @@ -1032,7 +1050,7 @@ function New-UnixPackage {
# This is a string because strings are appended to it
[string]$Iteration = "1",

# Host architecture values allowed for deb type packages: amd64
# Host architecture values allowed for deb type packages: amd64, arm64
# Host architecture values allowed for rpm type packages include: x86_64, aarch64, native, all, noarch, any
# Host architecture values allowed for osxpkg type packages include: x86_64, arm64
[string]
Expand Down
Loading