fix(ci): provide full Perl for Windows package builds

This commit is contained in:
t8y2
2026-08-23 11:12:38 +08:00
parent 1db4148a93
commit 3b66e88356
+48 -10
View File
@@ -356,14 +356,33 @@ jobs:
cache-targets: false
cache-on-failure: true
- name: Ensure vendored OpenSSL Perl modules on Windows
- name: Setup full Perl for vendored OpenSSL on Windows
if: runner.os == 'Windows'
shell: bash
shell: pwsh
env:
PERL_ARCHIVE_URL: https://github.com/shogo82148/build-perl/releases/download/perl-5.42.3-20260803012115/perl-5.42.3-thr-win32-x64.zip
PERL_ARCHIVE_SHA256: 4f0ac6fe1a4221c1fa1804c2d81999bdecebd505a61d0d04720e9b3925cd6db4
run: |
if ! perl -MParams::Check -e 1 >/dev/null 2>&1; then
cpan -T Params::Check
$archive = Join-Path $env:RUNNER_TEMP "perl-5.42.3-thr-win32-x64.zip"
$destination = Join-Path $env:RUNNER_TEMP "openssl-perl"
curl.exe --fail --location --retry 5 --retry-all-errors $env:PERL_ARCHIVE_URL --output $archive
if ($LASTEXITCODE -ne 0) {
throw "Unable to download the full Perl runtime."
fi
perl -MParams::Check -e 1
$actualHash = (Get-FileHash -Path $archive -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualHash -ne $env:PERL_ARCHIVE_SHA256) {
throw "Unexpected Perl archive SHA256: $actualHash"
}
Expand-Archive -Path $archive -DestinationPath $destination -Force
$perl = Get-ChildItem -Path $destination -Filter perl.exe -Recurse | Where-Object { $_.FullName -match '[\\/]bin[\\/]perl\.exe$' } | Select-Object -First 1
if (-not $perl) {
throw "Unable to locate perl.exe in the downloaded runtime."
}
& $perl.FullName -MParams::Check -e 1
if ($LASTEXITCODE -ne 0) {
throw "The downloaded Perl runtime cannot load Params::Check."
}
"OPENSSL_SRC_PERL=$($perl.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install Linux native dependencies
if: runner.os == 'Linux'
@@ -555,14 +574,33 @@ jobs:
cache-targets: false
cache-on-failure: true
- name: Ensure vendored OpenSSL Perl modules on Windows
- name: Setup full Perl for vendored OpenSSL on Windows
if: runner.os == 'Windows'
shell: bash
shell: pwsh
env:
PERL_ARCHIVE_URL: https://github.com/shogo82148/build-perl/releases/download/perl-5.42.3-20260803012115/perl-5.42.3-thr-win32-x64.zip
PERL_ARCHIVE_SHA256: 4f0ac6fe1a4221c1fa1804c2d81999bdecebd505a61d0d04720e9b3925cd6db4
run: |
if ! perl -MParams::Check -e 1 >/dev/null 2>&1; then
cpan -T Params::Check
$archive = Join-Path $env:RUNNER_TEMP "perl-5.42.3-thr-win32-x64.zip"
$destination = Join-Path $env:RUNNER_TEMP "openssl-perl"
curl.exe --fail --location --retry 5 --retry-all-errors $env:PERL_ARCHIVE_URL --output $archive
if ($LASTEXITCODE -ne 0) {
throw "Unable to download the full Perl runtime."
fi
perl -MParams::Check -e 1
$actualHash = (Get-FileHash -Path $archive -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actualHash -ne $env:PERL_ARCHIVE_SHA256) {
throw "Unexpected Perl archive SHA256: $actualHash"
}
Expand-Archive -Path $archive -DestinationPath $destination -Force
$perl = Get-ChildItem -Path $destination -Filter perl.exe -Recurse | Where-Object { $_.FullName -match '[\\/]bin[\\/]perl\.exe$' } | Select-Object -First 1
if (-not $perl) {
throw "Unable to locate perl.exe in the downloaded runtime."
}
& $perl.FullName -MParams::Check -e 1
if ($LASTEXITCODE -ne 0) {
throw "The downloaded Perl runtime cannot load Params::Check."
}
"OPENSSL_SRC_PERL=$($perl.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install Linux native dependencies
if: runner.os == 'Linux'