mirror of
https://github.com/actions/python-versions.git
synced 2025-12-16 15:58:16 +00:00
Compare commits
2 Commits
test-win-1
...
test-macos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c43a26a97f | ||
|
|
7bf4da577b |
70
.github/workflows/build-python-packages.yml
vendored
70
.github/workflows/build-python-packages.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
|||||||
switch -wildcard ($os) {
|
switch -wildcard ($os) {
|
||||||
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux"); if ($arch -eq "arm64" ) { $os = "${os}-arm" } }
|
"*ubuntu*" { $platform = $os.Replace("ubuntu","linux"); if ($arch -eq "arm64" ) { $os = "${os}-arm" } }
|
||||||
"*macos*" { $platform = 'darwin' }
|
"*macos*" { $platform = 'darwin' }
|
||||||
"*windows*" { $platform = 'win32'; if ($arch -eq "arm64" ) { $os = "${os}-arm" } }
|
"*windows*" { $platform = 'win32'; if ($arch -eq "arm64" ) { $os = "setup-actions-windows-arm64-4-core" } }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($buildMode -eq "freethreaded") {
|
if ($buildMode -eq "freethreaded") {
|
||||||
@@ -85,6 +85,29 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
steps:
|
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
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -116,6 +139,28 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
ARTIFACT_NAME: python-${{ inputs.VERSION || '3.12.3' }}-${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
steps:
|
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
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -146,28 +191,6 @@ jobs:
|
|||||||
}
|
}
|
||||||
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
|
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
|
||||||
|
|
||||||
- name: Check OS Architecture and Python Binary
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
Write-Host "OS Architecture:"
|
|
||||||
[System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture
|
|
||||||
|
|
||||||
$pythonPath = "C:\\hostedtoolcache\\windows\\Python\\${{ env.VERSION }}\\${{ matrix.arch }}\\python.exe"
|
|
||||||
Write-Host "Checking python.exe path: $pythonPath"
|
|
||||||
if (Test-Path $pythonPath) {
|
|
||||||
$file = Get-Item $pythonPath
|
|
||||||
Write-Host "python.exe exists. Size: $($file.Length) bytes"
|
|
||||||
} else {
|
|
||||||
Write-Host "python.exe is missing at $pythonPath"
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Listing Toolcache directory:"
|
|
||||||
Get-ChildItem "C:\\hostedtoolcache\\windows\\Python\\${{ env.VERSION }}\\${{ matrix.arch }}" -Recurse -Force
|
|
||||||
|
|
||||||
Write-Host "Listing extracted artifact contents:"
|
|
||||||
Get-ChildItem -Recurse "${{ runner.temp }}\\${{ env.ARTIFACT_NAME }}"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Apply build artifact to the local machine
|
- name: Apply build artifact to the local machine
|
||||||
run: |
|
run: |
|
||||||
$PSNativeCommandUseErrorActionPreference = $true
|
$PSNativeCommandUseErrorActionPreference = $true
|
||||||
@@ -215,7 +238,6 @@ jobs:
|
|||||||
}
|
}
|
||||||
working-directory: ${{ github.workspace }}/tests
|
working-directory: ${{ github.workspace }}/tests
|
||||||
|
|
||||||
|
|
||||||
publish_release:
|
publish_release:
|
||||||
name: Publish release
|
name: Publish release
|
||||||
if: github.event_name == 'workflow_dispatch' && inputs.PUBLISH_RELEASES
|
if: github.event_name == 'workflow_dispatch' && inputs.PUBLISH_RELEASES
|
||||||
|
|||||||
Reference in New Issue
Block a user