@@ -162,27 +162,11 @@ jobs:
162162
163163 - name : Download, verify and extract python standalone
164164 if : env.WINPYREQUIREMENTS != ''
165- shell : pwsh
166- run : |
167- Write-Output "Downloading, hash-checking, and extracting $env:python_source"
168- curl.exe -L -o "python-3-embed.tar.gz" $env:python_source
169-
170- $expectedHash = $env:python_sha256
171- $actualHash = (Get-FileHash -Path "python-3-embed.tar.gz" -Algorithm SHA256).Hash.ToLower()
172- if ($actualHash -ne $expectedHash.ToLower()) {
173- Write-Error "SHA mismatch: Actual $actualHash doesn't match $expectedHash"
174- exit 1
175- } else { Write-Output "Python SHA ok" }
176-
177- mkdir dotpythonpre -Force
178- mkdir dotpython -Force
179- mkdir dotpython/python -Force
180- tar -xf python-3-embed.tar.gz -C dotpythonpre
181- if (Test-Path dotpythonpre/python/install) {
182- Move-Item -Path dotpythonpre/python/install/* -Destination dotpython/python -Force
183- } elseif (Test-Path dotpythonpre/python) {
184- Move-Item -Path dotpythonpre/python/* -Destination dotpython/python -Force
185- }
165+ uses : ./.github/actions/python-setup
166+ with :
167+ python_source : ${{ env.python_source }}
168+ python_sha256 : ${{ env.python_sha256 }}
169+ build_location : ${{ env.build_location }}
186170
187171 - name : Copy launchers_final files to dotpython
188172 if : env.WINPYREQUIREMENTS != ''
@@ -207,34 +191,11 @@ jobs:
207191
208192 - name : Download, checking hash and integrating pandoc binary
209193 if : env.WINPYREQUIREMENTS != '' && env.PANDOC == '1'
210- shell : pwsh
211- run : |
212- $pandocZipPath = "pandoc.zip"
213- $tempDir = "pandoc_temp"
214- $targetDir = Join-Path $env:build_location "t"
215- Write-Host "Downloading Pandoc from $env:pandoc_source"
216- curl.exe -L -o $pandocZipPath $env:pandoc_source
217-
218- $expectedHash = $env:pandoc_sha256.ToLower()
219- $actualHash = (Get-FileHash -Path $pandocZipPath -Algorithm SHA256).Hash.ToLower()
220-
221- if ($actualHash -ne $expectedHash) {
222- Write-Error "Pandoc SHA mismatch: $actualHash vs expected $expectedHash"
223- exit 1
224- } else { Write-Output "Pandoc SHA ok" }
225-
226- Expand-Archive -Path $pandocZipPath -DestinationPath $tempDir -Force
227- New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
228-
229- Write-Output "Copying pandoc.exe to $targetDir"
230- Copy-Item -Path (Join-Path $tempDir "pandoc-3.1.9\pandoc.exe") -Destination $targetDir -Force
231-
232- Write-Output "Showing the content of $targetDir"
233- Get-ChildItem -Path $targetDir
234-
235- Write-Output "Cleaning up temporary files..."
236- Remove-Item -Path $tempDir -Recurse -Force
237- Remove-Item -Path $pandocZipPath -Force
194+ uses : ./.github/actions/pandoc-setup
195+ with :
196+ pandoc_source : ${{ env.pandoc_source }}
197+ pandoc_sha256 : ${{ env.pandoc_sha256 }}
198+ build_location : ${{ env.build_location }}
238199
239200 - name : Upgrade pip and patch launchers
240201 if : env.WINPYREQUIREMENTS != ''
0 commit comments