mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
[release/v7.6] Replace fpm with native macOS packaging tools (pkgbuild/productbuild) (#26501)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
TravisEz13
parent
0e83f60c0e
commit
ce725ce207
@@ -157,7 +157,7 @@ jobs:
|
||||
runner_os: macos-15-large
|
||||
test_results_artifact_name: testResults-xunit
|
||||
PackageMac-macos_packaging:
|
||||
name: macOS packaging (bootstrap only)
|
||||
name: macOS packaging and testing
|
||||
needs:
|
||||
- changes
|
||||
if: ${{ needs.changes.outputs.source == 'true' }}
|
||||
@@ -166,12 +166,63 @@ jobs:
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 1000
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
global-json-file: ./global.json
|
||||
- name: Bootstrap packaging
|
||||
if: success() || failure()
|
||||
if: success()
|
||||
run: |-
|
||||
import-module ./build.psm1
|
||||
start-psbootstrap -Scenario package
|
||||
shell: pwsh
|
||||
- name: Build PowerShell and Create macOS package
|
||||
if: success()
|
||||
run: |-
|
||||
import-module ./build.psm1
|
||||
import-module ./tools/ci.psm1
|
||||
import-module ./tools/packaging/packaging.psm1
|
||||
Switch-PSNugetConfig -Source Public
|
||||
Sync-PSTags -AddRemoteIfMissing
|
||||
$releaseTag = Get-ReleaseTag
|
||||
Start-PSBuild -Configuration Release -PSModuleRestore -ReleaseTag $releaseTag
|
||||
$macOSRuntime = if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') { 'osx-arm64' } else { 'osx-x64' }
|
||||
Start-PSPackage -Type osxpkg -ReleaseTag $releaseTag -MacOSRuntime $macOSRuntime -SkipReleaseChecks
|
||||
shell: pwsh
|
||||
- name: Test package contents
|
||||
if: success()
|
||||
run: |-
|
||||
$env:PACKAGE_FOLDER = Get-Location
|
||||
$testResultsPath = Join-Path $env:RUNNER_WORKSPACE "testResults"
|
||||
if (-not (Test-Path $testResultsPath)) {
|
||||
New-Item -ItemType Directory -Path $testResultsPath -Force | Out-Null
|
||||
}
|
||||
Import-Module Pester
|
||||
$pesterConfig = New-PesterConfiguration
|
||||
$pesterConfig.Run.Path = './tools/packaging/releaseTests/macOSPackage.tests.ps1'
|
||||
$pesterConfig.Run.PassThru = $true
|
||||
$pesterConfig.Output.Verbosity = 'Detailed'
|
||||
$pesterConfig.TestResult.Enabled = $true
|
||||
$pesterConfig.TestResult.OutputFormat = 'NUnitXml'
|
||||
$pesterConfig.TestResult.OutputPath = Join-Path $testResultsPath "macOSPackage.xml"
|
||||
$result = Invoke-Pester -Configuration $pesterConfig
|
||||
if ($result.FailedCount -gt 0) {
|
||||
throw "Package validation failed with $($result.FailedCount) failed test(s)"
|
||||
}
|
||||
shell: pwsh
|
||||
- name: Publish and Upload Pester Test Results
|
||||
if: always()
|
||||
uses: "./.github/actions/test/process-pester-results"
|
||||
with:
|
||||
name: "macOSPackage"
|
||||
testResultsFolder: "${{ runner.workspace }}/testResults"
|
||||
- name: Upload package artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: macos-package
|
||||
path: "*.pkg"
|
||||
ready_to_merge:
|
||||
name: macos ready to merge
|
||||
needs:
|
||||
|
||||
Reference in New Issue
Block a user