diff --git a/.pipelines/templates/release-validate-packagenames.yml b/.pipelines/templates/release-validate-packagenames.yml index c717b50f28..6344418cd8 100644 --- a/.pipelines/templates/release-validate-packagenames.yml +++ b/.pipelines/templates/release-validate-packagenames.yml @@ -82,7 +82,7 @@ jobs: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.pkg | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx(\.10\.12)?\-(x64|arm64)\.pkg') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance diff --git a/test/packaging/macos/package-validation.tests.ps1 b/test/packaging/macos/package-validation.tests.ps1 index 02b09fbb07..945ffea6f7 100644 --- a/test/packaging/macos/package-validation.tests.ps1 +++ b/test/packaging/macos/package-validation.tests.ps1 @@ -82,12 +82,13 @@ Describe "Verify macOS Package" { $script:package | Should -Not -BeNullOrEmpty # Regex pattern for valid macOS PKG package names. + # This pattern matches the validation used in release-validate-packagenames.yml # Valid examples: - # - powershell-7.4.13-osx-x64.pkg (Intel x64 - note: x64 with hyphens for compatibility) - # - powershell-7.4.13-osx-arm64.pkg (Apple Silicon) - # - powershell-preview-7.6.0-preview.6-osx-x64.pkg - # - powershell-lts-7.4.13-osx-arm64.pkg - $pkgPackageNamePattern = '^powershell(-preview|-lts)?-\d+\.\d+\.\d+(-[a-z]+\.\d+)?-osx-(x64|arm64)\.pkg$' + # - powershell-7.4.13-osx-x64.pkg (Stable release) + # - powershell-7.6.0-preview.6-osx-x64.pkg (Preview version string) + # - powershell-7.4.13-rebuild.5-osx-arm64.pkg (Rebuild version) + # - powershell-lts-7.4.13-osx-arm64.pkg (LTS package) + $pkgPackageNamePattern = '^powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?osx\-(x64|arm64)\.pkg$' $script:package.Name | Should -Match $pkgPackageNamePattern -Because "Package name should follow the standard naming convention" } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 8ba2052e81..11b475ad6a 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1145,15 +1145,12 @@ function New-UnixPackage { } # Determine if the version is a preview version - $IsPreview = Test-IsPreview -Version $Version -IsLTS:$LTS - - # Preview versions have preview in the name + # Only LTS packages get a prefix in the name + # Preview versions are identified by the version string itself (e.g., 7.6.0-preview.6) + # Rebuild versions are also identified by the version string (e.g., 7.4.13-rebuild.5) $Name = if($LTS) { "powershell-lts" } - elseif ($IsPreview) { - "powershell-preview" - } else { "powershell" }