Skip to content

Commit

Permalink
Use the installed version of Python
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrojnar committed Jun 29, 2024
1 parent 76ee550 commit f57c213
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,29 @@ jobs:
python3.8 -m pip install --upgrade pip
python3.8 -m pip install cryptography
- name: Find the latest version of Python (Windows)
if: runner.os == 'Windows'
run: |
$pythonVersions = Get-ChildItem -Path "C:/hostedtoolcache/windows/Python/" -Directory | Where-Object { $_.Name -match '\d+\.\d+\.\d+' } | Sort-Object { [Version]($_.Name) } -Descending
if ($pythonVersions.Count -gt 0) {
$latestPythonVersion = $pythonVersions[0].Name
$pythonPath = "C:/hostedtoolcache/windows/Python/$latestPythonVersion/x64"
Write-Output "Latest Python version found: $latestPythonVersion"
Write-Output "Python directory path: $pythonPath"
$env:Path = "$pythonPath;" + $env:Path
Write-Output "Updated PATH environment variable:"
Write-Output $env:Path
} else {
Write-Error "No Python versions found in C:/hostedtoolcache/windows/Python/"
exit 1
}
- name: Install python3 cryptography module (Windows)
if: runner.os == 'Windows'
run: |
C:/hostedtoolcache/windows/Python/3.12.3/x64/python3.exe -m ensurepip
C:/hostedtoolcache/windows/Python/3.12.3/x64/python.exe -m pip install --upgrade pip
C:/hostedtoolcache/windows/Python/3.12.3/x64/python.exe -m pip install cryptography
python.exe -m ensurepip
python.exe -m pip install --upgrade pip
python.exe -m pip install cryptography
- name: Configure CMake
run: cmake
Expand Down

0 comments on commit f57c213

Please sign in to comment.