diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2381f66..1f9dbc03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: timeout-minutes: 60 strategy: matrix: - php_version: [ '83', '84', '85' ] + php_version: [ '83', '84', '85', '86' ] steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9495ec41..eaadacde 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: script: | const matrix = { platform: ['linux/amd64', 'linux/arm64'], - php_version: ['83', '84', '85'], + php_version: ['83', '84', '85', '86'], } // If this is a third-party pull request, skip ARM builds diff --git a/Dockerfile b/Dockerfile index 16acb797..ded1c92f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -82,8 +82,13 @@ ENV MAKEFLAGS='-j4' # --fail makes sure that curl returns an error instead of fetching the 404 page ARG FULL_PHP_VERSION WORKDIR /tmp/php -RUN curl --location --silent --show-error --fail --retry 3 "https://www.php.net/distributions/php-${FULL_PHP_VERSION}.tar.gz" \ - | tar xzC . --strip-components=1 +# Pre-releases (alpha, beta, RC) are not on php.net/distributions: take the tag's source from GitHub +# (without the generated files, which `buildconf` below generates) +RUN case "${FULL_PHP_VERSION}" in \ + *alpha*|*beta*|*RC*) url="https://github.com/php/php-src/archive/refs/tags/php-${FULL_PHP_VERSION}.tar.gz" ;; \ + *) url="https://www.php.net/distributions/php-${FULL_PHP_VERSION}.tar.gz" ;; \ + esac; \ + curl --location --silent --show-error --fail --retry 3 "$url" | tar xzC . --strip-components=1 # Configure the build # -fstack-protector-strong : Be paranoid about stack overflows @@ -141,8 +146,25 @@ RUN set -xe; \ make clean # Optional extensions installed with `pecl`, not enabled by default -RUN pecl install APCu -RUN pecl install redis-6.3.0 +ARG PHP_VERSION +# APCu's latest release (5.1.28) does not compile with PHP 8.6: use its main branch (pinned) until 5.1.29 +RUN if [ "${PHP_VERSION}" -ge 86 ]; then \ + mkdir -p /tmp/apcu && cd /tmp/apcu \ + && curl --location --silent --show-error --fail --retry 3 https://github.com/krakjoe/apcu/archive/fb2c942552a3f5dab7f4dea4afb5cf0831222c57.tar.gz \ + | tar xzC . --strip-components=1 \ + && phpize && ./configure && make && make install && cd / && rm -rf /tmp/apcu; \ + else \ + pecl install APCu; \ + fi +# phpredis' latest release (6.3.0) does not compile with PHP 8.6: use its develop branch (pinned) until the next release +RUN if [ "${PHP_VERSION}" -ge 86 ]; then \ + mkdir -p /tmp/redis && cd /tmp/redis \ + && curl --location --silent --show-error --fail --retry 3 https://github.com/phpredis/phpredis/archive/959dee1ca9ed55500cf90365419f8232eca3a99c.tar.gz \ + | tar xzC . --strip-components=1 \ + && phpize && ./configure && make && make install && cd / && rm -rf /tmp/redis; \ + else \ + pecl install redis-6.3.0; \ + fi # Gather all extensions in one directory, independent of PHP's internal API version RUN set -xe; \ @@ -237,7 +259,17 @@ FROM build-environment AS build-php # Build the dev image with xdebug FROM build-environment AS build-dev -RUN pecl install xdebug-3.5.0 && cp "$(php -r 'echo ini_get("extension_dir");')"/xdebug.so /tmp/xdebug.so +ARG PHP_VERSION +# xdebug's latest release (3.5.3) supports PHP up to 8.5: use its main branch (pinned) for PHP 8.6 +RUN if [ "${PHP_VERSION}" -ge 86 ]; then \ + mkdir -p /tmp/xdebug && cd /tmp/xdebug \ + && curl --location --silent --show-error --fail --retry 3 https://github.com/xdebug/xdebug/archive/64007df3a0925808022fb87b6c6f06febf058ee2.tar.gz \ + | tar xzC . --strip-components=1 \ + && phpize && ./configure --enable-xdebug && make && make install && cd / && rm -rf /tmp/xdebug; \ + else \ + pecl install xdebug-3.5.0; \ + fi; \ + cp "$(php -r 'echo ini_get("extension_dir");')"/xdebug.so /tmp/xdebug.so FROM php AS dev diff --git a/Makefile b/Makefile index 1320aec0..707dd22b 100644 --- a/Makefile +++ b/Makefile @@ -30,13 +30,13 @@ default: docker-images # Build Docker images *locally* -docker-images: docker-images-php-83 docker-images-php-84 docker-images-php-85 +docker-images: docker-images-php-83 docker-images-php-84 docker-images-php-85 docker-images-php-86 docker-images-php-%: PHP_VERSION=$* ${BAKE_COMMAND} --load # Build and publish multi-architecture images to Docker Hub. -upload-to-docker-hub: upload-to-docker-hub-php-83 upload-to-docker-hub-php-84 upload-to-docker-hub-php-85 +upload-to-docker-hub: upload-to-docker-hub-php-83 upload-to-docker-hub-php-84 upload-to-docker-hub-php-85 upload-to-docker-hub-php-86 upload-to-docker-hub-php-%: # Make sure we have defined the docker tag (test $(DOCKER_TAG)) && echo "Tagging images with \"${DOCKER_TAG}\"" || echo "You have to define environment variable DOCKER_TAG" @@ -48,12 +48,12 @@ upload-to-docker-hub-php-%: --set "php-dev.tags=bref/php-$*-dev:4" --set "php-dev.tags=bref/php-$*-dev:${DOCKER_TAG}" -test: test-83 test-84 test-85 +test: test-83 test-84 test-85 test-86 test-%: cd tests && $(MAKE) test-$* -clean: clean-83 clean-84 clean-85 +clean: clean-83 clean-84 clean-85 clean-86 # Clear the build cache, else all images will be rebuilt using cached layers docker builder prune clean-%: diff --git a/docker-bake.hcl b/docker-bake.hcl index a08a4743..66aec9a6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -17,6 +17,8 @@ variable "FULL_PHP_VERSIONS" { "83" = "8.3.37" "84" = "8.4.28" "85" = "8.5.13" + # Release candidate: final release planned for late November 2026 + "86" = "8.6.0RC5" } } diff --git a/tests/Makefile b/tests/Makefile index 68b47e0e..7b1338bd 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,5 @@ -test: test-83 test-84 test-85 +test: test-83 test-84 test-85 test-86 # This rule matches with a wildcard, for example `test-84`. # The `$*` variable will contained the matched part, in this case `84`.