From 4067ce8b814db5bfc731c8906aa3034f28911e9f Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 4 May 2021 23:43:26 +0530 Subject: [PATCH] Deprecate Ubuntu 16.04 --- README.md | 5 ++--- dist/index.js | 3 +++ src/install.ts | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e5b4cc8d..b13c7262 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Both `GitHub-hosted` and `self-hosted` runners are suppported by `setup-php` on |Virtual environment|YAML workflow label|Pre-installed PHP| |--- |--- |--- | -|Ubuntu 16.04|`ubuntu-16.04`|`PHP 5.6` to `PHP 8.0`| +|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`| @@ -77,7 +77,6 @@ Both `GitHub-hosted` and `self-hosted` runners are suppported by `setup-php` on |Host OS/Virtual environment|YAML workflow label| |--- |--- | -|Ubuntu 16.04|`self-hosted` or `Linux`| |Ubuntu 18.04|`self-hosted` or `Linux`| |Ubuntu 20.04|`self-hosted` or `Linux`| |Windows 7 and newer|`self-hosted` or `Windows`| @@ -632,7 +631,7 @@ 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 +# For runs-on: ubuntu-16.04 (deprecated) act -P ubuntu-16.04=shivammathur/node:1604 ``` diff --git a/dist/index.js b/dist/index.js index 51a6badd..28c75b9e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -439,6 +439,9 @@ async function getScript(filename, version, os_version) { exports.getScript = getScript; async function run() { try { + if ((await utils.readEnv('ImageOS')) == 'ubuntu16') { + core.warning('Ubuntu 16.04 is deprecated.\nPlease upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'); + } const version = await utils.parseVersion(await utils.getInput('php-version', true)); if (version) { const os_version = process.platform; diff --git a/src/install.ts b/src/install.ts index b8323432..c30b751d 100644 --- a/src/install.ts +++ b/src/install.ts @@ -51,6 +51,11 @@ export async function getScript( */ export async function run(): Promise { try { + if ((await utils.readEnv('ImageOS')) == 'ubuntu16') { + core.warning( + 'Ubuntu 16.04 is deprecated.\nPlease upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452' + ); + } const version: string = await utils.parseVersion( await utils.getInput('php-version', true) );