Update build-python-packages.yml

This commit is contained in:
aparnajyothi-y
2024-06-19 18:55:04 +05:30
committed by GitHub
parent fd01c577f2
commit cd751e6cc2

View File

@@ -39,13 +39,15 @@ jobs:
- name: Generate execution matrix
id: generate-matrix
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_arm64' }}".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_x86,windows-2019_arm64' }}".Split(",").Trim()
$matrix = @()
foreach ($configuration in $configurations) {
$parts = $configuration.Split("_")
$os = $parts[0]
$arch = if ($parts[1]) {$parts[1]} else {"x64"}
$runner_name = if ($os -eq 'windows-2019' -and $arch -eq 'arm64') {'setup-actions-windows-arm64-4-core'} else {''}
switch -wildcard ($os) {
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux")}
"*macos*" { $platform = 'darwin' }
@@ -56,6 +58,7 @@ jobs:
'os' = $os
'arch' = $arch
'runner_name' = $runner_name
}
}
echo "matrix=$($matrix | ConvertTo-Json -Compress -AsArray)" >> $env:GITHUB_OUTPUT
@@ -71,7 +74,7 @@ jobs:
steps:
- name: Install Chocolatey
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
@@ -79,28 +82,32 @@ jobs:
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install PowerShell
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: cmd
run: |
choco install powershell-core -y
- name: Add PowerShell to PATH
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install Git
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: cmd
run: |
choco install git -y
- name: Add Git to PATH
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Check git version
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
run: |
git --version
@@ -110,12 +117,13 @@ jobs:
submodules: true
- name: Install 7-Zip
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: cmd
run: |
choco install 7zip -y
- name: Add 7-Zip to PATH
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
@@ -142,7 +150,7 @@ jobs:
steps:
- name: Install Chocolatey
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
@@ -150,28 +158,33 @@ jobs:
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install PowerShell
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: cmd
run: |
choco install powershell-core -y
- name: Add PowerShell to PATH
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Install Git
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: cmd
run: |
choco install git -y
- name: Add Git to PATH
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Check git version
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
run: |
git --version
- name: Check out repository code
@@ -194,12 +207,14 @@ jobs:
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Install 7-Zip
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: cmd
run: |
choco install 7zip -y
- name: Add 7-Zip to PATH
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' && env.RUNNER_NAME == 'setup-actions-windows-arm64-4-core'
if: matrix.os == 'windows-2019' && matrix.arch == 'arm64' && matrix.runner_name == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8