Skip to content

Commit 0e5f00e

Browse files
Add windows arm64 support (#291)
* Update build-python-packages.yml * windows arm64 support * Update build-python-packages.yml * Update build-python-packages.yml * Update build-python-packages.yml * Update build-python-packages.yml * Update build-python-packages.yml
1 parent 1d2e861 commit 0e5f00e

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

.github/workflows/build-python-packages.yml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
PLATFORMS:
1616
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
1717
required: true
18-
default: 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,macos-11_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86'
18+
default: 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,macos-13_x64,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64'
1919
pull_request:
2020
paths-ignore:
2121
- 'versions-manifest.json'
@@ -39,7 +39,7 @@ jobs:
3939
- name: Generate execution matrix
4040
id: generate-matrix
4141
run: |
42-
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,macos-11,macos-14_arm64,windows-2019_x64,windows-2019_x86' }}".Split(",").Trim()
42+
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-20.04,ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,macos-13,macos-14_arm64,windows-2019_x64,windows-2019_x86,windows-2019_arm64' }}".Split(",").Trim()
4343
$matrix = @()
4444
4545
foreach ($configuration in $configurations) {
@@ -51,8 +51,10 @@ jobs:
5151
"*macos*" { $platform = 'darwin' }
5252
"*windows*" { $platform = 'win32' }
5353
}
54-
if ($configuration -eq "ubuntu-22.04_arm64") {
54+
if ($configuration -eq "ubuntu-22.04_arm64") {
5555
$os = "setup-actions-ubuntu-arm64-2-core"
56+
}elseif ($configuration -eq "windows-2019_arm64") {
57+
$os = "setup-actions-windows-arm64-4-core"
5658
}
5759
$matrix += @{
5860
'platform' = $platform
@@ -72,6 +74,29 @@ jobs:
7274
env:
7375
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
7476
steps:
77+
- name: Setup Environment on Windows ARM64 Runner
78+
if: matrix.os == 'setup-actions-windows-arm64-4-core'
79+
shell: powershell
80+
run: |
81+
# Install Chocolatey
82+
Set-ExecutionPolicy Bypass -Scope Process -Force
83+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
84+
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
85+
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
86+
87+
# Install PowerShell
88+
choco install powershell-core -y
89+
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
90+
91+
# Install Git
92+
choco install git -y
93+
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
94+
95+
96+
# Install 7-Zip
97+
choco install 7zip -y
98+
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
99+
75100
76101
- name: Check out repository code
77102
uses: actions/checkout@v4
@@ -100,7 +125,29 @@ jobs:
100125
env:
101126
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
102127
steps:
103-
128+
- name: Setup Environment on Windows ARM64 Runner
129+
if: matrix.os == 'setup-actions-windows-arm64-4-core'
130+
shell: powershell
131+
run: |
132+
# Install Chocolatey
133+
Set-ExecutionPolicy Bypass -Scope Process -Force
134+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
135+
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
136+
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
137+
138+
# Install PowerShell
139+
choco install powershell-core -y
140+
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
141+
142+
# Install Git
143+
choco install git -y
144+
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
145+
146+
147+
# Install 7-Zip
148+
choco install 7zip -y
149+
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
150+
104151
- name: Check out repository code
105152
uses: actions/checkout@v4
106153
with:
@@ -241,4 +288,3 @@ jobs:
241288
workflow_id: 'create-pr.yml',
242289
ref: 'main'
243290
});
244-

builders/win-python-builder.psm1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class WinPythonBuilder : PythonBuilder {
6060
} else {
6161
$ArchitectureExtension = ".amd64"
6262
}
63+
}elseif ($this.Architecture -eq "arm64") {
64+
$ArchitectureExtension = "-arm64"
6365
}
6466

6567
return $ArchitectureExtension

0 commit comments

Comments
 (0)