File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -138,12 +138,29 @@ jobs:
138
138
python3.8 -m pip install --upgrade pip
139
139
python3.8 -m pip install cryptography
140
140
141
+ - name : Find the latest version of Python (Windows)
142
+ if : runner.os == 'Windows'
143
+ run : |
144
+ $pythonVersions = Get-ChildItem -Path "C:/hostedtoolcache/windows/Python/" -Directory | Where-Object { $_.Name -match '\d+\.\d+\.\d+' } | Sort-Object { [Version]($_.Name) } -Descending
145
+ if ($pythonVersions.Count -gt 0) {
146
+ $latestPythonVersion = $pythonVersions[0].Name
147
+ $pythonPath = "C:/hostedtoolcache/windows/Python/$latestPythonVersion/x64"
148
+ Write-Output "Latest Python version found: $latestPythonVersion"
149
+ Write-Output "Python directory path: $pythonPath"
150
+ $env:Path = "$pythonPath;" + $env:Path
151
+ Write-Output "Updated PATH environment variable:"
152
+ Write-Output $env:Path
153
+ } else {
154
+ Write-Error "No Python versions found in C:/hostedtoolcache/windows/Python/"
155
+ exit 1
156
+ }
157
+
141
158
- name : Install python3 cryptography module (Windows)
142
159
if : runner.os == 'Windows'
143
160
run : |
144
- C:/hostedtoolcache/windows/Python/3.12.3/x64/python3 .exe -m ensurepip
145
- C:/hostedtoolcache/windows/Python/3.12.3/x64/ python.exe -m pip install --upgrade pip
146
- C:/hostedtoolcache/windows/Python/3.12.3/x64/ python.exe -m pip install cryptography
161
+ python .exe -m ensurepip
162
+ python.exe -m pip install --upgrade pip
163
+ python.exe -m pip install cryptography
147
164
148
165
- name : Configure CMake
149
166
run : cmake
You can’t perform that action at this time.
0 commit comments