From 3b66e883566b89e58f3e18517bb32dbb1b2fcd74 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Sun, 23 Aug 2026 11:12:38 +0800 Subject: [PATCH] fix(ci): provide full Perl for Windows package builds --- .github/workflows/mcp-release.yml | 58 +++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 10 deletions(-) diff --git a/.github/workflows/mcp-release.yml b/.github/workflows/mcp-release.yml index 48f1001f04..5308f03741 100644 --- a/.github/workflows/mcp-release.yml +++ b/.github/workflows/mcp-release.yml @@ -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'