Compare commits

..

1 Commits

Author SHA1 Message Date
Haritha 6aa4f2fae2 Enhance build workflow for Windows ARM64 support on self hosted runner
Updated default platforms to include windows-2022_arm64 and added setup steps for Windows ARM64 runner.
2026-01-09 10:58:25 -06:00
6 changed files with 74 additions and 1253 deletions
+70 -23
View File
@@ -20,7 +20,7 @@ on:
PLATFORMS:
description: 'Platforms for execution in "os" or "os_arch" format (arch is "x64" by default)'
required: true
default: 'ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-15-intel_x64,macos-14_arm64,windows-2022_x64,windows-2022_x86,windows-11_arm64'
default: 'ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-15-intel_x64,macos-14_arm64,windows-2022_x64,windows-2022_x86,windows-2022_arm64'
pull_request:
paths-ignore:
- 'versions-manifest.json'
@@ -44,7 +44,7 @@ jobs:
- name: Generate execution matrix
id: generate-matrix
run: |
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-15-intel,macos-14_arm64,windows-2022_x64,windows-2022_x86,windows-11_arm64' }}".Split(",").Trim()
[String[]]$configurations = "${{ inputs.platforms || 'ubuntu-22.04,ubuntu-22.04_arm64,ubuntu-24.04,ubuntu-24.04_arm64,macos-15-intel,macos-14_arm64,windows-2022_x64,windows-2022_x86,windows-2022_arm64' }}".Split(",").Trim()
[String[]]$buildModes = "${{ inputs.threading_build_modes || 'default' }}".Split(",").Trim()
$matrix = @()
@@ -56,7 +56,11 @@ jobs:
switch -wildcard ($os) {
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux"); if ($arch -eq "arm64" ) { $os = "${os}-arm" } }
"*macos*" { $platform = 'darwin' }
"*windows*" { $platform = 'win32'; if ($arch -eq "arm64" ) { $os = "${os}-arm" } }
"*windows*" { $platform = 'win32' }
}
if ($configuration -eq "windows-2022_arm64") {
$os = "setup-actions-windows-arm64-4-core"
}
if ($buildMode -eq "freethreaded") {
@@ -85,8 +89,32 @@ jobs:
env:
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.13.7' }}-${{ matrix.platform }}-${{ matrix.arch }}
steps:
- name: Setup Environment on Windows ARM64 Runner
if: matrix.os == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
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
# Install PowerShell
choco install powershell-core -y
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install Git
choco install git -y
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install 7-Zip
choco install 7zip -y
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Check out repository code
uses: actions/checkout@v6
uses: actions/checkout@v5
with:
submodules: true
@@ -96,7 +124,7 @@ jobs:
-Platform ${{ matrix.platform }} -Architecture ${{ matrix.arch }}
- name: Publish artifact
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact
@@ -112,8 +140,31 @@ jobs:
env:
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.13.7' }}-${{ matrix.platform }}-${{ matrix.arch }}
steps:
- name: Setup Environment on Windows ARM64 Runner
if: matrix.os == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
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
# Install PowerShell
choco install powershell-core -y
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install Git
choco install git -y
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install 7-Zip
choco install 7zip -y
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Check out repository code
uses: actions/checkout@v6
uses: actions/checkout@v5
with:
submodules: true
@@ -126,7 +177,7 @@ jobs:
run: if [ -d /Library/Frameworks/Python.framework ]; then sudo rm -rf /Library/Frameworks/Python.framework; fi
- name: Download artifact
uses: actions/download-artifact@v7
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
@@ -154,7 +205,7 @@ jobs:
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Setup Python ${{ env.VERSION }}
uses: actions/setup-python@v6
uses: actions/setup-python@v5
with:
python-version: ${{ env.VERSION }}
architecture: ${{ matrix.arch }}
@@ -195,22 +246,18 @@ jobs:
needs: test_python
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v4
- name: Publish Release ${{ env.VERSION }}
id: create_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
tag_name="${{ env.VERSION }}-${{ github.run_id }}"
gh release create "$tag_name" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ env.VERSION }}" \
--notes="Python ${{ env.VERSION }}"
release_id=$(gh release view "$tag_name" --repo "$GITHUB_REPOSITORY" --json databaseId --jq '.databaseId')
echo "id=$release_id" >> $GITHUB_OUTPUT
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}-${{ github.run_id }}
release_name: ${{ env.VERSION }}
body: |
Python ${{ env.VERSION }}
- name: Generate hash for packages
run: |
@@ -225,7 +272,7 @@ jobs:
}
- name: Upload release assets
uses: actions/github-script@v8
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
@@ -249,7 +296,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger "Create Pull Request" workflow
uses: actions/github-script@v8
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v5
with:
submodules: true
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v6
uses: actions/checkout@v5
- name: Trigger python workflow
run: |
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
python: [3.9.13, 3.10.11, 3.11.8, 3.12.7, 3.13.0]
steps:
- name: setup-python ${{ matrix.python }}
uses: actions/setup-python@v6
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
+1 -9
View File
@@ -73,7 +73,7 @@ class NixPythonBuilder : PythonBuilder {
$sourceUri = $this.GetSourceUri()
Write-Host "Sources URI: $sourceUri"
$archiveFilepath = Download-File -Uri $sourceUri -OutputFolder $this.TempFolderLocation
$archiveFilepath = Download-File -Uri $sourceUri -OutputFolder $this.WorkFolderLocation
$expandedSourceLocation = Join-Path -Path $this.TempFolderLocation -ChildPath "SourceCode"
New-Item -Path $expandedSourceLocation -ItemType Directory
@@ -146,14 +146,6 @@ class NixPythonBuilder : PythonBuilder {
$sourcesLocation = $this.Download()
Push-Location -Path $sourcesLocation
# Patch for 3.15.0a6: Fix test_bz2 BIG_DATA to ensure two compressed blocks
# See: https://github.com/python/cpython/pull/145730
if (($this.Architecture -match "arm64") -and ($this.Platform -match "22\.04") -and ($this.Version -eq [semver]"3.15.0-alpha.6")) {
Write-Host "Applying patch for python/cpython#145730 (test_bz2 fix)..."
Execute-Command -Command "curl -sL -o Lib/test/test_bz2.py https://raw.githubusercontent.com/python/cpython/19676e5fc28bdee8325a062a31ddeee60960cf75/Lib/test/test_bz2.py"
}
Write-Host "Configure for $($this.Platform)..."
$this.Configure()
File diff suppressed because it is too large Load Diff