Skip to content

Commit 3627730

Browse files
committed
ssl windows
1 parent b792cfe commit 3627730

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,39 @@ jobs:
4343
if: matrix.os == 'windows-latest'
4444
run: |
4545
choco install php --version=8.2 --params '"/ExtensionList:mbstring,curl,openssl,xml"'
46+
$phpIni = php --ini | Select-String "Loaded Configuration File"
47+
$phpIniPath = ($phpIni -split "=>")[1].Trim()
48+
Add-Content $phpIniPath "curl.cainfo=C:/tools/cacert.pem"
49+
Add-Content $phpIniPath "openssl.cafile=C:/tools/cacert.pem"
50+
mkdir C:/tools -ErrorAction SilentlyContinue
51+
Invoke-WebRequest -Uri https://curl.se/ca/cacert.pem -OutFile C:/tools/cacert.pem
4652
refreshenv
4753
php -v
4854
shell: pwsh
4955

5056
- name: Install Composer (Windows)
5157
if: matrix.os == 'windows-latest'
5258
run: |
59+
# Download and verify Composer installer
60+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
5361
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
62+
# Set PHP to use the CA certificate we downloaded
63+
$env:SSL_CERT_FILE="C:/tools/cacert.pem"
64+
$env:CURL_CA_BUNDLE="C:/tools/cacert.pem"
5465
php composer-setup.php
5566
php -r "unlink('composer-setup.php');"
5667
mkdir -p C:\tools\composer
5768
move composer.phar C:\tools\composer\composer
5869
echo "C:\tools\composer" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
5970
shell: pwsh
6071

61-
- name: Install Composer (Unix)
62-
if: matrix.os != 'windows-latest'
72+
- name: Install dependencies (Windows)
73+
if: matrix.os == 'windows-latest'
6374
run: |
64-
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
65-
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
66-
php -r "unlink('composer-setup.php');"
67-
sudo chmod +x /usr/local/bin/composer
68-
mkdir -p ~/.composer
69-
if [ "$RUNNER_OS" == "Linux" ]; then
70-
sudo chown -R $USER:$USER ~/.composer
71-
fi
72-
shell: bash
75+
$env:SSL_CERT_FILE="C:/tools/cacert.pem"
76+
$env:CURL_CA_BUNDLE="C:/tools/cacert.pem"
77+
composer install --prefer-dist --no-progress --ignore-platform-req=ext-pcntl
78+
shell: pwsh
7379

7480
- name: Get Composer Cache Directory
7581
id: composer-cache

0 commit comments

Comments
 (0)