Skip to content

Commit

Permalink
Sunset support for Ubuntu 16.04
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Aug 2, 2021
1 parent ca910e5 commit 947009a
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -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`|
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions src/install.ts
Expand Up @@ -52,9 +52,10 @@ export async function getScript(
export async function run(): Promise<void> {
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)
Expand Down
4 changes: 0 additions & 4 deletions src/scripts/common.sh
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/scripts/ext/cubrid.sh
Expand Up @@ -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)"
Expand Down
9 changes: 1 addition & 8 deletions src/scripts/linux.sh
Expand Up @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions src/scripts/tools/grpc_php_plugin.sh
Expand Up @@ -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"
Expand Down

0 comments on commit 947009a

Please sign in to comment.