diff --git a/dist/index.js b/dist/index.js index c13b7f89..6af12830 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2882,7 +2882,7 @@ async function addExtensionDarwin(extension_csv, version) { add_script += await utils.customPackage(ext_name, 'ext', extension, 'darwin'); return; // match pre-release versions. For example - xdebug-beta - case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): + case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(version_extension): add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix); return; // match semver @@ -2948,8 +2948,8 @@ async function addExtensionWindows(extension_csv, version) { add_script += await utils.customPackage(ext_name, 'ext', extension, 'win32'); return; // match pre-release versions. For example - xdebug-beta - case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): - add_script += await utils.joins('\nAdd-Extension', ext_name, ext_version); + case /.*-(stable|beta|alpha|devel|snapshot)/.test(version_extension): + add_script += await utils.joins('\nAdd-Extension', ext_name, ext_version.replace('stable', '')); break; // match semver without state case /.*-\d+\.\d+\.\d+$/.test(version_extension): @@ -3029,7 +3029,7 @@ async function addExtensionLinux(extension_csv, version) { add_script += await utils.customPackage(ext_name, 'ext', extension, 'linux'); return; // match pre-release versions. For example - xdebug-beta - case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): + case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(version_extension): add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix); return; // match semver versions diff --git a/src/extensions.ts b/src/extensions.ts index 17cdb847..47321727 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -43,7 +43,9 @@ export async function addExtensionDarwin( ); return; // match pre-release versions. For example - xdebug-beta - case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): + case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test( + version_extension + ): add_script += await utils.joins( '\nadd_unstable_extension', ext_name, @@ -135,11 +137,11 @@ export async function addExtensionWindows( ); return; // match pre-release versions. For example - xdebug-beta - case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): + case /.*-(stable|beta|alpha|devel|snapshot)/.test(version_extension): add_script += await utils.joins( '\nAdd-Extension', ext_name, - ext_version + ext_version.replace('stable', '') ); break; // match semver without state @@ -246,7 +248,9 @@ export async function addExtensionLinux( ); return; // match pre-release versions. For example - xdebug-beta - case /.*-(beta|alpha|devel|snapshot)/.test(version_extension): + case /.*-(stable|beta|alpha|devel|snapshot|rc|preview)/.test( + version_extension + ): add_script += await utils.joins( '\nadd_unstable_extension', ext_name, diff --git a/src/scripts/common.sh b/src/scripts/common.sh index f1da5f83..e29e550a 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -112,7 +112,7 @@ enable_extension() { # Function to configure PECL. configure_pecl() { - if ! [ -e /tmp/pecl_config ] && command -v pecl >/dev/null; then + if ! [ -e /tmp/pecl_config ] && command -v pecl >/dev/null && command -v pear >/dev/null; then for script in pear pecl; do sudo "$script" config-set php_ini "${pecl_file:-$ini_file}" sudo "$script" channel-update "$script".php.net @@ -124,7 +124,7 @@ configure_pecl() { # Function to get the PECL version of an extension. get_pecl_version() { extension=$1 - stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot|preview)")" + stability="$(echo "$2" | grep -m 1 -Eio "(stable|alpha|beta|rc|snapshot|preview)")" pecl_rest='https://pecl.php.net/rest/r/' response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml) pecl_version=$(echo "$response" | grep -m 1 -Eio "([0-9]+\.[0-9]+\.[0-9]+${stability}[0-9]+)") @@ -137,6 +137,7 @@ get_pecl_version() { # Function to install PECL extensions and accept default options pecl_install() { local extension=$1 + configure_pecl >/dev/null 2>&1 yes '' 2>/dev/null | sudo pecl install -f "$extension" >/dev/null 2>&1 } diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 847343ee..7ad0438e 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -138,7 +138,6 @@ setup_php() { scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||") sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer" semver=$(php -v | head -n 1 | cut -f 2 -d ' ') - if [[ ! "$version" =~ $old_versions ]]; then configure_pecl >/dev/null 2>&1; fi sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/" add_log "$tick" "PHP" "$status PHP $semver" } diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 5fa2bc88..bd64e47d 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -160,9 +160,7 @@ add_devtools() { fi sudo update-alternatives --set php-config /usr/bin/php-config"$version" >/dev/null 2>&1 sudo update-alternatives --set phpize /usr/bin/phpize"$version" >/dev/null 2>&1 - if command -v pecl >/dev/null; then - configure_pecl >/dev/null 2>&1 - fi + configure_pecl >/dev/null 2>&1 add_log "${tick:?}" "$tool" "Added $tool $semver" } @@ -174,7 +172,6 @@ setup_nightly() { # Function to setup PHP 5.3, PHP 5.4 and PHP 5.5. setup_old_versions() { run_script "php5-ubuntu" "$version" - configure_pecl release_version=$(php -v | head -n 1 | cut -d' ' -f 2) }