Skip to content

Commit 4aa65a7

Browse files
TravisEz13Copilot
andauthored
Update the macos package name for preview releases to match the previous pattern (#26429)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1fd3ea8 commit 4aa65a7

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- pwsh: |
8383
$message = @()
8484
Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.pkg | ForEach-Object {
85-
if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx(\.10\.12)?\-(x64|arm64)\.pkg')
85+
if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg')
8686
{
8787
$messageInstance = "$($_.Name) is not a valid package name"
8888
$message += $messageInstance

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,13 @@ Describe "Verify macOS Package" {
8282
$script:package | Should -Not -BeNullOrEmpty
8383

8484
# Regex pattern for valid macOS PKG package names.
85+
# This pattern matches the validation used in release-validate-packagenames.yml
8586
# Valid examples:
86-
# - powershell-7.4.13-osx-x64.pkg (Intel x64 - note: x64 with hyphens for compatibility)
87-
# - powershell-7.4.13-osx-arm64.pkg (Apple Silicon)
88-
# - powershell-preview-7.6.0-preview.6-osx-x64.pkg
89-
# - powershell-lts-7.4.13-osx-arm64.pkg
90-
$pkgPackageNamePattern = '^powershell(-preview|-lts)?-\d+\.\d+\.\d+(-[a-z]+\.\d+)?-osx-(x64|arm64)\.pkg$'
87+
# - powershell-7.4.13-osx-x64.pkg (Stable release)
88+
# - powershell-7.6.0-preview.6-osx-x64.pkg (Preview version string)
89+
# - powershell-7.4.13-rebuild.5-osx-arm64.pkg (Rebuild version)
90+
# - powershell-lts-7.4.13-osx-arm64.pkg (LTS package)
91+
$pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$'
9192

9293
$script:package.Name | Should -Match $pkgPackageNamePattern -Because "Package name should follow the standard naming convention"
9394
}

tools/packaging/packaging.psm1

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,15 +1159,12 @@ function New-UnixPackage {
11591159
}
11601160

11611161
# Determine if the version is a preview version
1162-
$IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS
1163-
1164-
# Preview versions have preview in the name
1162+
# Only LTS packages get a prefix in the name
1163+
# Preview versions are identified by the version string itself (e.g., 7.6.0-preview.6)
1164+
# Rebuild versions are also identified by the version string (e.g., 7.4.13-rebuild.5)
11651165
$Name = if($LTS) {
11661166
"powershell-lts"
11671167
}
1168-
elseif ($IsPreview) {
1169-
"powershell-preview"
1170-
}
11711168
else {
11721169
"powershell"
11731170
}

0 commit comments

Comments
 (0)