mirror of
https://github.com/actions/python-versions.git
synced 2025-12-14 06:26:45 +00:00
Update build-python-packages.yml
This commit is contained in:
52
.github/workflows/build-python-packages.yml
vendored
52
.github/workflows/build-python-packages.yml
vendored
@@ -15,7 +15,7 @@ on:
|
|||||||
PLATFORMS:
|
PLATFORMS:
|
||||||
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
|
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
|
||||||
required: true
|
required: true
|
||||||
default: 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,setup-actions-windows-arm64-4-core'
|
default: 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'versions-manifest.json'
|
- 'versions-manifest.json'
|
||||||
@@ -32,31 +32,33 @@ defaults:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
generate_matrix:
|
generate_matrix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.generate-matrix.outputs.matrix }}
|
matrix: ${{ steps.generate-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- name: Generate execution matrix
|
- name: Generate execution matrix
|
||||||
id: generate-matrix
|
id: generate-matrix
|
||||||
run: |
|
run: |
|
||||||
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11,macos-14_arm64,windows-2019_x64,windows-2019_x86' }}".Split(",").Trim()
|
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-20.04_arm64,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-11,macos-14_arm64,windows-2019_x64,windows-2019_arm64' }}".Split(",").Trim()
|
||||||
$matrix = @()
|
$matrix = @()
|
||||||
foreach ($configuration in $configurations) {
|
foreach ($configuration in $configurations) {
|
||||||
$parts = $configuration.Split("_")
|
$parts = $configuration.Split("_")
|
||||||
$os = $parts[0]
|
$os = $parts[0]
|
||||||
$arch = if ($parts[1]) {$parts[1]} else {"x64"}
|
$arch = if ($parts[1]) {$parts[1]} else {"x64"}
|
||||||
switch -wildcard ($os) {
|
$runner_name = if ($os -eq 'windows-2019' -and $arch -eq 'arm64') {'setup-actions-windows-arm64-4-core'} else {''}
|
||||||
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux")}
|
switch -wildcard ($os) {
|
||||||
"*macos*" { $platform = 'darwin' }
|
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux")}
|
||||||
"*windows*" { $platform = 'win32' }
|
"*macos*" { $platform = 'darwin' }
|
||||||
}
|
"*windows*" { $platform = 'win32' }
|
||||||
$matrix += @{
|
|
||||||
'platform' = $platform
|
|
||||||
'os' = $os
|
|
||||||
'arch' = $arch
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT
|
$matrix += @{
|
||||||
|
'platform' = $platform
|
||||||
|
'os' = $os
|
||||||
|
'arch' = $arch
|
||||||
|
'runner_name' = $runner_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT
|
||||||
build_python:
|
build_python:
|
||||||
needs: generate_matrix
|
needs: generate_matrix
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
Reference in New Issue
Block a user