Skip to content

Commit e98d38a

Browse files
author
jayeshmepani
committed
fix: streamline PowerShell command for downloading PHP Devel Pack in CI workflow
1 parent 33b5a44 commit e98d38a

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

.github/workflows/benchmarks.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,20 @@ jobs:
5858
cp swisseph_tmp/src/*.h sweph/src/ 2>/dev/null || cp swisseph_tmp/*.h sweph/src/ 2>/dev/null || true
5959
6060
# Download matching Devel Pack for headers/libs
61-
PHP_VER=$(php -v | head -n 1 | cut -d ' ' -f 2)
61+
PHP_VER=$(php -v | head -n 1 | cut -d " " -f 2)
6262
echo "Detected PHP Version: $PHP_VER"
6363
64-
# Construct download URL (assuming x64 NTS which is standard for GH runners)
65-
# We use a robust PowerShell download
66-
powershell <<'POWERSHELL_EOF'
67-
$phpVer = (php -v)[0].Split(' ')[1]
68-
echo "Downloading Devel Pack for $phpVer..."
69-
$url = "https://windows.php.net/downloads/releases/php-devel-pack-$phpVer-Win32-vs16-x64.zip"
70-
try {
71-
Invoke-WebRequest -Uri $url -OutFile "php-devel.zip"
72-
Expand-Archive -Path "php-devel.zip" -DestinationPath "php-sdk-root"
73-
} catch {
74-
echo "Exact version pack not found. Building with FFI only."
75-
}
76-
POWERSHELL_EOF
64+
# Use PowerShell to download and extract the SDK without a heredoc
65+
powershell -Command "
66+
$phpVer = (php -v)[0].Split(' ')[1];
67+
echo 'Downloading Devel Pack for $phpVer...';
68+
$url = \"https://windows.php.net/downloads/releases/php-devel-pack-$phpVer-Win32-vs16-x64.zip\";
69+
try {
70+
Invoke-WebRequest -Uri $url -OutFile 'php-devel.zip';
71+
Expand-Archive -Path 'php-devel.zip' -DestinationPath 'php-sdk-root';
72+
} catch {
73+
echo 'Exact version pack not found. Building with FFI only.';
74+
}"
7775
7876
if [ -d "php-sdk-root" ]; then
7977
# Locate headers and libs in the extracted pack

0 commit comments

Comments
 (0)