From 947009a71769c25ab5292f073f5343624b7c879d Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 2 Aug 2021 23:10:43 +0530 Subject: [PATCH] Sunset support for Ubuntu 16.04 --- .github/workflows/docs.yml | 4 ++-- .github/workflows/workflow.yml | 2 +- README.md | 4 ---- dist/index.js | 3 ++- src/install.ts | 5 +++-- src/scripts/common.sh | 4 ---- src/scripts/ext/cubrid.sh | 1 - src/scripts/linux.sh | 9 +-------- src/scripts/tools/grpc_php_plugin.sh | 6 +----- 9 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cbe8253e4..10cdd0e85 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-2019, macos-10.15] + operating-system: [ubuntu-20.04, ubuntu-18.04, windows-2019, macos-10.15] php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] steps: - name: Setup PHP @@ -59,7 +59,7 @@ jobs: run: | git config --local user.email "${{ secrets.email }}" git config --local user.name "${{ github.repository_owner }}" - for os in ubuntu-20.04 ubuntu-18.04 ubuntu-16.04 windows-2019 macos-10.15 macos-11.0; do + for os in ubuntu-20.04 ubuntu-18.04 windows-2019 macos-10.15 macos-11.0; do echo "These are extensions which are loaded by default on the following PHP versions. More extensions which are available as packages and available on pecl are supported by setup-php. Refer to [php extension support](https://github.com/shivammathur/setup-php#heavy_plus_sign-php-extension-support) for more details." > Php-extensions-loaded-on-"$os".md for version in 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1; do if [ "$os" = "macos-11.0" ]; then diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6e3db9ca4..a053961ab 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest] + operating-system: [ubuntu-20.04, ubuntu-18.04, windows-latest, macos-latest] php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] env: extensions: xml, opcache, xdebug, pcov diff --git a/README.md b/README.md index 79396b244..49b4029b8 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ Both `GitHub-hosted` and `self-hosted` runners are suppported by `setup-php` on |Virtual environment|YAML workflow label|Pre-installed PHP| |--- |--- |--- | -|Ubuntu 16.04 [(deprecated)](https://setup-php.com/i/452)|`ubuntu-16.04`|`PHP 5.6` to `PHP 8.0`| |Ubuntu 18.04|`ubuntu-18.04`|`PHP 7.1` to `PHP 8.0`| |Ubuntu 20.04|`ubuntu-latest` or `ubuntu-20.04`|`PHP 7.4` to `PHP 8.0`| |Windows Server 2019|`windows-latest` or `windows-2019`|`PHP 8.0`| @@ -663,9 +662,6 @@ act -P ubuntu-20.04=shivammathur/node:2004 # For runs-on: ubuntu-18.04 act -P ubuntu-18.04=shivammathur/node:1804 - -# For runs-on: ubuntu-16.04 (deprecated) -act -P ubuntu-16.04=shivammathur/node:1604 ``` ### JIT Configuration diff --git a/dist/index.js b/dist/index.js index b20577017..11eb25b91 100644 --- a/dist/index.js +++ b/dist/index.js @@ -440,7 +440,8 @@ exports.getScript = getScript; async function run() { try { if ((await utils.readEnv('ImageOS')) == 'ubuntu16') { - core.warning('setup-php will stop working on Ubuntu 16.04 from August 1, 2021. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'); + core.setFailed('setup-php is not supported on Ubuntu 16.04. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'); + return; } const version = await utils.parseVersion(await utils.getInput('php-version', true)); if (version) { diff --git a/src/install.ts b/src/install.ts index 7f8185ee4..a79d1894b 100644 --- a/src/install.ts +++ b/src/install.ts @@ -52,9 +52,10 @@ export async function getScript( export async function run(): Promise { try { if ((await utils.readEnv('ImageOS')) == 'ubuntu16') { - core.warning( - 'setup-php will stop working on Ubuntu 16.04 from August 1, 2021. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452' + core.setFailed( + 'setup-php is not supported on Ubuntu 16.04. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452' ); + return; } const version: string = await utils.parseVersion( await utils.getInput('php-version', true) diff --git a/src/scripts/common.sh b/src/scripts/common.sh index 80e067418..88c664ca3 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -83,10 +83,6 @@ run_script() { # Function to install required packages on self-hosted runners. self_hosted_setup() { if [ "$runner" = "self-hosted" ]; then - if [ "$DISTRIB_RELEASE" = "16.04" ] && [ "$CONTAINER" != "shivammathur/node" ]; then - add_log "$cross" "Ubuntu" "Ubuntu 16.04 (Xenial Xerus) is no longer supported on self-hosted runner" - exit 1 - fi if [[ "${version:?}" =~ $old_versions ]]; then add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner" exit 1 diff --git a/src/scripts/ext/cubrid.sh b/src/scripts/ext/cubrid.sh index 36feeaec1..8864f6883 100644 --- a/src/scripts/ext/cubrid.sh +++ b/src/scripts/ext/cubrid.sh @@ -39,7 +39,6 @@ add_cubrid_helper() { status='Installed and enabled' set_cubrid_repo set_cubrid_branch - [ "$DISTRIB_RELEASE" = "16.04" ] && setup_compiler patch_phpize read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration" read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)" diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 996dec8eb..e9a42a3ed 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -21,17 +21,10 @@ cleanup_lists() { # Function to add ppa:ondrej/php. add_ppa() { ppa=${1:-ondrej/php} - if [ "$DISTRIB_RELEASE" = "16.04" ] && [ "$ppa" = "ondrej/php" ]; then - LC_ALL=C.UTF-8 sudo apt-add-repository --remove ppa:"$ppa" -y || true - LC_ALL=C.UTF-8 sudo apt-add-repository http://setup-php.com/ondrej/php/ubuntu -y - sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 4f4ea0aae5267a6c - elif ! apt-cache policy | grep -q "$ppa"; then + if ! apt-cache policy | grep -q "$ppa"; then cleanup_lists "$(dirname "$ppa")" LC_ALL=C.UTF-8 sudo apt-add-repository ppa:"$ppa" -y fi - if [ "$DISTRIB_RELEASE" = "16.04" ]; then - sudo "$debconf_fix" apt-get update - fi } # Function to update the package lists. diff --git a/src/scripts/tools/grpc_php_plugin.sh b/src/scripts/tools/grpc_php_plugin.sh index ec39c66cd..54c15eb87 100644 --- a/src/scripts/tools/grpc_php_plugin.sh +++ b/src/scripts/tools/grpc_php_plugin.sh @@ -38,11 +38,7 @@ add_grpc_php_plugin_compile() { ( cd "/tmp/grpc-${grpc_tag:1}" || exit add_bazel - if [ "$DISTRIB_RELEASE" = "16.04" ]; then - CC="$(command -v gcc)" CXX="$(command -v g++)" ./tools/bazel build src/compiler:grpc_php_plugin - else - ./tools/bazel build src/compiler:grpc_php_plugin - fi + ./tools/bazel build src/compiler:grpc_php_plugin sudo mv ./bazel-bin/src/compiler/grpc_php_plugin /usr/local/bin/grpc_php_plugin sudo chmod a+x /usr/local/bin/grpc_php_plugin license_path="/tmp/grpc-${grpc_tag:1}/LICENSE"