Compare commits

...

4 Commits

7 changed files with 28 additions and 19 deletions

View File

@ -28,7 +28,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
operating-system: [ubuntu-22.04, ubuntu-20.04, windows-2019, macos-latest] operating-system: [ubuntu-22.04, ubuntu-20.04, windows-2019, macos-13]
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
include: include:
- operating-system: ubuntu-22.04 - operating-system: ubuntu-22.04

View File

@ -100,7 +100,8 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
On all supported OS/Platforms the following PHP versions can be set up as per the runner. On all supported OS/Platforms the following PHP versions can be set up as per the runner.
- PHP 5.3 to PHP 8.4 on GitHub-hosted runners. - PHP 5.3 to PHP 8.4 on GitHub-hosted runners, except for macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.4 on GitHub-hosted macOS ARM64 runners (macos-14).
- PHP 5.6 to PHP 8.4 on self-hosted runners. - PHP 5.6 to PHP 8.4 on self-hosted runners.
| PHP Version | Stability | Release Support | Runner Support | | PHP Version | Stability | Release Support | Runner Support |

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.30.3", "version": "2.30.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "setup-php", "name": "setup-php",
"version": "2.30.3", "version": "2.30.4",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.10.1", "@actions/core": "^1.10.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "setup-php", "name": "setup-php",
"version": "2.30.3", "version": "2.30.4",
"private": false, "private": false,
"description": "Setup PHP for use with GitHub Actions", "description": "Setup PHP for use with GitHub Actions",
"main": "lib/install.js", "main": "lib/install.js",

View File

@ -168,6 +168,7 @@ add_php() {
else else
brew install -f "$php_formula" brew install -f "$php_formula"
fi fi
sudo chown -R "$(id -un)":"$(id -gn)" "$brew_prefix"
brew link --force --overwrite "$php_formula" brew link --force --overwrite "$php_formula"
} }

View File

@ -66,7 +66,7 @@ Function Enable-Extension() {
} }
# Function to add custom built PHP extension for nightly builds. # Function to add custom built PHP extension for nightly builds.
Function Add-NightlyExtension { Function Add-ExtensionFromGithub {
Param ( Param (
[Parameter(Position = 0, Mandatory = $true)] [Parameter(Position = 0, Mandatory = $true)]
[ValidateNotNull()] [ValidateNotNull()]
@ -123,7 +123,7 @@ Function Add-Extension {
} }
else { else {
if(($version -match $nightly_versions) -and (Select-String -Path $src\configs\windows_extensions -Pattern $extension -SimpleMatch -Quiet)) { if(($version -match $nightly_versions) -and (Select-String -Path $src\configs\windows_extensions -Pattern $extension -SimpleMatch -Quiet)) {
Add-NightlyExtension $extension Add-ExtensionFromGithub $extension
} else { } else {
# Patch till DLLs for PHP 8.1 and above are released as stable. # Patch till DLLs for PHP 8.1 and above are released as stable.
$minimumStability = $stability $minimumStability = $stability

View File

@ -29,7 +29,7 @@ Function Get-SqlsrvReleaseUrl()
} }
# Function to add sqlsrv extension from GitHub. # Function to add sqlsrv extension from GitHub.
Function Add-SqlsrvFromGithub() Function Add-SqlsrvFromMSGithub()
{ {
Param ( Param (
[Parameter(Position = 0, Mandatory = $true)] [Parameter(Position = 0, Mandatory = $true)]
@ -37,16 +37,18 @@ Function Add-SqlsrvFromGithub()
[string] [string]
$extension $extension
) )
$zipUrl = SqlsrvReleaseUrl try {
if($zipUrl) { $zipUrl = SqlsrvReleaseUrl
$nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" } if($zipUrl) {
$noDotVersion = $version.replace('.', '') $nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" }
$extensionFilePath = "Windows-$version\$arch\php_${extension}_${noDotVersion}_${nts}.dll" $noDotVersion = $version.replace('.', '')
Get-File -Url $zipUrl -OutFile $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip > $null 2>&1 $extensionFilePath = "Windows-$version\$arch\php_${extension}_${noDotVersion}_${nts}.dll"
Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\sqlsrv -Force > $null 2>&1 Get-File -Url $zipUrl -OutFile $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip > $null 2>&1
Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\sqlsrv\$extensionFilePath" -Destination "$ext_dir\php_$extension.dll" Expand-Archive -Path $ENV:RUNNER_TOOL_CACHE\sqlsrv.zip -DestinationPath $ENV:RUNNER_TOOL_CACHE\sqlsrv -Force > $null 2>&1
Enable-PhpExtension -Extension $extension -Path $php_dir Copy-Item -Path "$ENV:RUNNER_TOOL_CACHE\sqlsrv\$extensionFilePath" -Destination "$ext_dir\php_$extension.dll"
} Enable-PhpExtension -Extension $extension -Path $php_dir
}
} catch { }
} }
# Function to add sqlsrv extension. # Function to add sqlsrv extension.
@ -61,7 +63,12 @@ Function Add-Sqlsrv() {
if (Test-Path $ext_dir\php_$extension.dll) { if (Test-Path $ext_dir\php_$extension.dll) {
Enable-PhpExtension -Extension $extension -Path $php_dir Enable-PhpExtension -Extension $extension -Path $php_dir
} else { } else {
Add-SqlsrvFromGithub $extension >$null 2>&1 try {
Add-ExtensionFromGithub $extension > $null 2>&1
} catch {}
if (-not(Test-Extension $extension)) {
Add-SqlsrvFromMSGithub $extension >$null 2>&1
}
if (-not(Test-Extension $extension)) { if (-not(Test-Extension $extension)) {
Add-Extension $extension >$null 2>&1 Add-Extension $extension >$null 2>&1
} }