Compare commits

...

8 Commits

10 changed files with 673 additions and 607 deletions

View File

@ -412,7 +412,7 @@ describe('Tools tests', () => {
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection "-V"',
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan "-v"',
'add_tool https://github.com/phan/phan/releases/download/1.2.3/phan.phar phan "-v"',
'add_tool https://www.phing.info/get/phing-1.2.3.phar phing "-v"',
'add_tool https://www.phing.info/get/phing-1.2.3.phar,https://github.com/phingofficial/phing/releases/download/1.2.3/phing-1.2.3.phar phing "-v"',
'add_composertool phinx phinx robmorgan/ scoped',
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive',
'add_devtools php-config',

6
dist/index.js vendored
View File

@ -789,6 +789,12 @@ exports.addPECL = addPECL;
async function addPhing(data) {
data['url'] =
data['domain'] + '/get/phing-' + data['version'] + data['extension'];
if (data['version'] != 'latest') {
[data['prefix'], data['verb']] = ['releases', 'download'];
data['domain'] = data['github'];
data['extension'] = '-' + data['version'] + data['extension'];
data['url'] += ',' + (await getUrl(data));
}
return await addArchive(data);
}
exports.addPhing = addPhing;

1194
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "setup-php",
"version": "2.17.0",
"version": "2.17.1",
"private": false,
"description": "Setup PHP for use with GitHub Actions",
"main": "lib/install.js",
@ -40,15 +40,15 @@
"fs": "0.0.1-security"
},
"devDependencies": {
"@types/jest": "^27.4.0",
"@types/node": "^17.0.16",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"@vercel/ncc": "^0.33.1",
"eslint": "^8.8.0",
"eslint-config-prettier": "^8.3.0",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.21",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"@vercel/ncc": "^0.33.3",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.4.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.0",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.5.1",
"jest-circus": "^27.5.1",

View File

@ -1,9 +1,9 @@
# Function to get sqlsrv and pdo_sqlsrv version.
get_sqlsrv_version() {
if [[ "${version:?}" =~ 7.[0-2] ]]; then
if [[ "${version:?}" =~ 7.[0-3] ]]; then
echo '5.9.0'
else
echo '5.10.0beta2'
echo '5.10.0'
fi
}

View File

@ -155,7 +155,7 @@ add_composertool() {
release=$2
prefix=$3
scope=$4
composer_major_version=$(cat /tmp/composer_version | cut -d'.' -f 1)
composer_major_version=$(cut -d'.' -f 1 /tmp/composer_version)
if [ "$composer_major_version" != "1" ]; then
composer_args="--ignore-platform-req=ext-*"
if [[ "$tool" =~ prestissimo|composer-prefetcher ]]; then

View File

@ -6,9 +6,13 @@ Function Add-Symfony() {
$url = "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_windows_${arch_name}.zip"
Invoke-WebRequest -Uri $url -OutFile $bin_dir\symfony.zip >$null 2>&1
Expand-Archive -Path $bin_dir\symfony.zip -DestinationPath $bin_dir -Force >$null 2>&1
Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe >$null 2>&1
Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe"
Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
$tool_version = Get-ToolVersion symfony "-V"
Add-Log $tick "symfony-cli" "Added symfony-cli $tool_version"
if(Test-Path $bin_dir\symfony.exe) {
Copy-Item -Path $bin_dir\symfony.exe -Destination $bin_dir\symfony-cli.exe > $null 2>&1
Add-ToProfile $current_profile 'symfony' "New-Alias symfony $bin_dir\symfony.exe"
Add-ToProfile $current_profile 'symfony_cli' "New-Alias symfony-cli $bin_dir\symfony-cli.exe"
$tool_version = Get-ToolVersion symfony "-V"
Add-Log $tick "symfony-cli" "Added symfony-cli $tool_version"
} else {
Add-Log $cross "symfony-cli" "Could not setup symfony-cli"
}
}

View File

@ -7,7 +7,12 @@ add_symfony() {
add_brew_tap symfony-cli/homebrew-tap
brew install symfony-cli/tap/symfony-cli >/dev/null 2>&1
fi
sudo ln -s "$(command -v symfony)" "${tool_path_dir:?}"/symfony-cli
tool_version=$(get_tool_version "symfony" "-V")
add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version"
symfony_path="$(command -v symfony)"
if [[ -n "$symfony_path" ]]; then
sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli
tool_version=$(get_tool_version "symfony" "-V")
add_log "${tick:?}" "symfony-cli" "Added symfony-cli $tool_version"
else
add_log "${cross:?}" "symfony-cli" "Could not setup symfony-cli"
fi
}

View File

@ -106,6 +106,7 @@ Function Add-Env {
Add-Content "$EnvName=$EnvValue" -Path $env:GITHUB_ENV -Encoding utf8
} else {
Set-ItemProperty -Path 'hkcu:\Environment' -Name $EnvName -Value $EnvValue
Add-ToProfile $current_profile $EnvName "`$env:$EnvName=`"$EnvValue`""
}
}
@ -117,11 +118,13 @@ Function Add-EnvPATH {
if(-not(Test-Path $EnvPATH)) {
return
}
$env_file = $current_profile
if ($env:GITHUB_ENV) {
$env_file = $env:GITHUB_ENV
$env_file = $env:GITHUB_ENV
$env_data = Get-Content -Path $EnvPATH
if (-not($env:GITHUB_ENV)) {
$env_file = $current_profile
$env_data = $env_data | ForEach-Object { '$env:' + $_ }
}
Get-Content -Path $EnvPATH | Add-Content -Path $env_file -Encoding utf8
$env_data | Add-Content -Path $env_file -Encoding utf8
}
# Function to make sure printf is in PATH.
@ -183,6 +186,17 @@ Function Add-PhpCAInfo {
}
}
# Function to set OpenSSL config.
Function Add-OpenSSLConf {
try {
Set-OpenSSLConf -Target User
} catch {
New-Item $php_dir\extras\openssl.cnf -Type File -Force > $null 2>&1
Set-OpenSSLConf -Path $php_dir\extras\openssl.cnf -Target User
}
Add-Env -EnvName OPENSSL_CONF -EnvValue $env:OPENSSL_CONF
}
# Function to set PHP config.
Function Add-PhpConfig {
$current = Get-Content -Path $php_dir\php.ini-current -ErrorAction SilentlyContinue
@ -347,6 +361,7 @@ if($version -lt "5.5") {
}
Enable-PhpExtension -Extension $enable_extensions -Path $php_dir
Add-PhpCAInfo
Add-OpenSSLConf
Copy-Item -Path $src\configs\pm\*.json -Destination $env:RUNNER_TOOL_CACHE
Set-Output php-version $($installed.FullVersion)
Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)$extra_version"

View File

@ -313,6 +313,12 @@ export async function addPECL(data: RS): Promise<string> {
export async function addPhing(data: RS): Promise<string> {
data['url'] =
data['domain'] + '/get/phing-' + data['version'] + data['extension'];
if (data['version'] != 'latest') {
[data['prefix'], data['verb']] = ['releases', 'download'];
data['domain'] = data['github'];
data['extension'] = '-' + data['version'] + data['extension'];
data['url'] += ',' + (await getUrl(data));
}
return await addArchive(data);
}