diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 492de49..61674cb 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -18,13 +18,36 @@ jobs: "debian/stretch", "debian/buster", "el/7" ] - php: [7.3, 7.4] - branch: ["v4.1.2"] - packagecloud_repo: ["stable-41"] + php: ["7.3", "7.4", "8.0"] + branch: ["v4.1.2", "v5.0.0alpha5"] + packagecloud_repo: ["stable-41", "nightly-50"] + zephir_parser_version: ["v1.3.8"] + zephir_version: ["0.12.21", "0.14.0-beta.3"] exclude: - os_dist: "ubuntu/trusty" - php: 7.4 + php: "7.4" + + - os_dist: "ubuntu/trusty" + php: "8.0" + + - branch: "v4.1.2" + php: "8.0" + + - branch: "v5.0.0alpha5" + php: "7.3" + + - branch: "v4.1.2" + packagecloud_repo: "nightly-50" + + - branch: "v4.1.2" + zephir_version: "0.14.0-beta.3" + + - branch: "v5.0.0alpha5" + packagecloud_repo: "stable-41" + + - branch: "v5.0.0alpha5" + zephir_version: "0.12.21" runs-on: ubuntu-18.04 # continue-on-error: ${{ matrix.experimental }} @@ -32,9 +55,6 @@ jobs: name: ${{ matrix.os_dist }} - PHP${{ matrix.php }} with ${{ matrix.branch }} env: -# OS: ${{ matrix.os }} -# DIST: ${{ matrix.dist }} -# PACKAGE: ${{ matrix.package }} CLONE_BRANCH: ${{ matrix.branch }} PHP_VERSION: ${{ matrix.php }} PACKAGECLOUD_REPO: ${{ matrix.packagecloud_repo }} @@ -55,8 +75,8 @@ jobs: # To build 4.x branch use # ZEPHIR_VERSION >= 0.11.0 (for example 0.12.15) # ZEPHIR_PARSER_VERSION >= v1.2.x (for example v1.3.3) - ZEPHIR_VERSION: "0.12.21" - ZEPHIR_PARSER_VERSION: "v1.3.6" +# ZEPHIR_VERSION: "0.12.21" +# ZEPHIR_PARSER_VERSION: "v1.3.6" ZEND_BACKEND: "--backend=ZendEngine3" STABLE_BUILD_VERSION: "1" @@ -76,22 +96,6 @@ jobs: with: fetch-depth: 1 - # Setup PHP -# - name: Setup cache environment -# id: extcache -# uses: shivammathur/cache-extensions@v1 -# with: -# php-version: ${{ matrix.php }} -# extensions: ${{ env.PHP_EXTENSIONS }} -# key: "phalcon-packagecloud-v1" - -# - name: Cache extensions -# uses: actions/cache@v2 -# with: -# path: ${{ steps.extcache.outputs.dir }} -# key: ${{ steps.extcache.outputs.key }} -# restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -104,6 +108,9 @@ jobs: echo "OS=${os_dist[0]}" >> $GITHUB_ENV echo "DIST=${os_dist[1]}" >> $GITHUB_ENV + echo "ZEPHIR_VERSION=${{ matrix.zephir_version }}" >> $GITHUB_ENV + echo "ZEPHIR_PARSER_VERSION=${{ matrix.zephir_parser_version }}" >> $GITHUB_ENV + echo "MAINLINE_BUILD_VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV echo "NIGHTLY_BUILD_VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV echo "SOURCEDIR=${GITHUB_WORKSPACE}/cphalcon" >> $GITHUB_ENV @@ -128,7 +135,6 @@ jobs: - name: Clone cphalcon uses: actions/checkout@v2 with: - fetch-depth: 1 repository: phalcon/cphalcon ref: ${{ env.CLONE_BRANCH }} path: cphalcon @@ -145,6 +151,12 @@ jobs: - run: ls -la build/ + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.OS }}-${{ env.DIST }}-php-${{ matrix.php }}-${{ matrix.branch }}.zip + path: build/ + - name: Push package to phalcon/${{ matrix.packagecloud_repo }}/${{ matrix.os_dist }} if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') run: | diff --git a/ci/prepare-debian.sh b/ci/prepare-debian.sh index 5c0db06..ec6a020 100755 --- a/ci/prepare-debian.sh +++ b/ci/prepare-debian.sh @@ -30,7 +30,7 @@ case "$PHP_VERSION" in cp debian/postinsts/legacy debian/php5-phalcon.postinst cp debian/preinsts/legacy debian/php5-phalcon.preinst ;; -"7.0" | "7.1"| "7.2" | "7.3" | "7.4") +"7.0" | "7.1"| "7.2" | "7.3" | "7.4" | "8.0") cp "debian/controls/php-${PHP_VERSION}" debian/control cp "debian/postinsts/php-${PHP_VERSION}" "debian/php${PHP_VERSION}-phalcon.postinst" cp "debian/preinsts/php-${PHP_VERSION}" "debian/php${PHP_VERSION}-phalcon.preinst" diff --git a/debian/controls/php-8.0 b/debian/controls/php-8.0 new file mode 100644 index 0000000..71d5de2 --- /dev/null +++ b/debian/controls/php-8.0 @@ -0,0 +1,35 @@ +Source: php-phalcon +Section: php +Priority: optional +Maintainer: Serghei Iakovlev +Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), build-essential, re2c, php8.0-dev, php8.0-json, libpcre3-dev +Standards-Version: 3.9.7 +Vcs-Git: git://github.com/phalcon/cphalcon.git +Vcs-Browser: https://github.com/phalcon/cphalcon + +Package: php8.0-phalcon +Architecture: any +Priority: optional +Pre-Depends: dpkg (>= 1.15.7.2) +Depends: ucf, ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php8.0-psr +Suggests: php8.0-mysql, php8.0-sqlite3, php8.0-pgsql, php8.0-memcached +Description: High performance PHP framework + Phalcon is an open source web framework delivered as a C extension for + the PHP language providing high performance and lower resource consumption. + . + This package provides the Phalcon PHP extension. + +Package: php8.0-phalcon-dbgsym +Depends: ucf, ${misc:Depends}, php8.0-phalcon (= ${binary:Version}) +Recommends: gdb +Replaces: php8.0-phalcon-dbg (<< 3.1.0) +Suggests: php8.0-common-dbgsym +Section: debug +Priority: extra +Architecture: any +Description: Debug symbols for php8.0-phalcon + Phalcon is an open source web framework delivered as a C extension for + the PHP language providing high performance and lower resource consumption. + . + This package provides the debug symbols for Phalcon PHP extension + needed for properly debugging errors with gdb. diff --git a/debian/postinsts/php-8.0 b/debian/postinsts/php-8.0 new file mode 100644 index 0000000..ec93466 --- /dev/null +++ b/debian/postinsts/php-8.0 @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +#EXTRA# + +if [ "$1" = "configure" ]; then + # Install the new versioned configuration + inidir=/etc/php/8.0/mods-available + + if [ -e /usr/lib/php/php-maintscript-helper ] ; then + . /usr/lib/php/php-maintscript-helper + + # Register new conffile with UCF + ucf /usr/share/php8.0-phalcon/phalcon/phalcon.ini ${inidir}/phalcon.ini + ucfr --force php8.0-phalcon ${inidir}/phalcon.ini + + if [ -f "${inidir}/phalcon.ini.dpkg-new" ]; then + md5sum="$(md5sum ${inidir}/phalcon.ini.dpkg-new | sed -e 's/ .*//')" + old_md5sum="$(md5sum ${inidir}/phalcon.ini | sed -e 's/ .*//')" + + if [ "$md5sum" = "$old_md5sum" ]; then + mv "${inidir}/phalcon.ini.dpkg-new" "${inidir}/phalcon.ini" + fi + fi + + php_invoke enmod 8.0 ALL phalcon + fi +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/preinsts/php-8.0 b/debian/preinsts/php-8.0 new file mode 100644 index 0000000..a716b2d --- /dev/null +++ b/debian/preinsts/php-8.0 @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e + +#EXTRA# + +if [ "$1" = "upgrade" ]; then + inidir=/etc/php/8.0/mods-available + + # First purge the old unversioned configuration + if [ -e ${inidir}/phalcon.ini ]; then + for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do + rm -f ${inidir}/phalcon.ini${ext} + done + + rm -f ${inidir}/phalcon.ini + + if which ucf >/dev/null; then + ucf --purge ${inidir}/phalcon.ini >/dev/null || true + fi + + if which ucfr >/dev/null; then + ucfr --force --purge php8.0-phalcon ${inidir}/phalcon.ini >/dev/null || true + fi + fi + + # Cleanup of the old symlinks (including broken symlinks) + find /etc/php/8.0/ -type l | + while read symlink; do + if [ "$(readlink $symlink)" = "${inidir}/phalcon.ini" ]; then + rm -f "${symlink}" + fi + done +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index a5f550a..ab53876 100755 --- a/debian/rules +++ b/debian/rules @@ -50,7 +50,10 @@ PHP_API_VERSION=$(shell php-config --phpapi) endif PHALCON_SUBSTVARS=$(PACKAGE).substvars + SOURCEDIR=build/php$(PHP_MAJOR_VERSION)/safe +SOURCEDIR_V5=build/phalcon + DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH) ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),i386)) @@ -80,17 +83,17 @@ prepare-files-stamp: touch prepare-files-stamp override_dh_auto_configure: - cd $(SOURCEDIR); \ + [ -d "$(SOURCEDIR_V5)" ] && cd $(SOURCEDIR_V5) || cd $(SOURCEDIR); \ phpize; \ ./configure --enable-phalcon=shared override_dh_auto_build: - $(MAKE) -C $(SOURCEDIR) + [ -d "$(SOURCEDIR_V5)" ] && $(MAKE) -C $(SOURCEDIR_V5) || $(MAKE) -C $(SOURCEDIR) override_dh_auto_clean: dh_auto_clean ( \ - cd $(SOURCEDIR); \ + [ -d "$(SOURCEDIR_V5)" ] && cd $(SOURCEDIR_V5) || cd $(SOURCEDIR); \ [ -f Makefile ] && $(MAKE) distclean; \ phpize --clean; \ rm -f tmp-php.ini; \ @@ -100,7 +103,7 @@ override_dh_installdirs: prepare-files-stamp dh_installdirs override_dh_auto_install: - INSTALL_ROOT=$(BUILD) $(MAKE) -C $(SOURCEDIR) install + [ -d "$(SOURCEDIR_V5)" ] && INSTALL_ROOT=$(BUILD) $(MAKE) -C $(SOURCEDIR_V5) install || INSTALL_ROOT=$(BUILD) $(MAKE) -C $(SOURCEDIR) install override_dh_strip: dh_strip -s --dbg-package=$(PACKAGE)-dbgsym