Build PHP #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build PHP | |
| on: | |
| workflow_dispatch: | |
| env: | |
| EXTENSIONS: amqp,apcu,ast,bcmath,brotli,calendar,ctype,curl,dom,ds,exif,ffi,fileinfo,filter,gd,gettext,iconv,igbinary,imagick,inotify,intl,ldap,libxml,mbregex,mbstring,memcache,memcached,mongodb,msgpack,mysqli,mysqlnd,opcache,openssl,opentelemetry,parallel,password-argon2,pcntl,pdo,pdo_mysql,pgsql,phar,posix,rdkafka,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,swoole-hook-mysql,swoole-hook-pgsql,swoole-hook-sqlite,tokenizer,xlswriter,xml,xmlreader,xmlwriter,xsl,yaml,zip,zlib,zstd | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: | |
| - version: 8.1 | |
| swoole: v5.1.8 | |
| - version: 8.2 | |
| swoole: v5.1.8 | |
| - version: 8.3 | |
| swoole: v5.1.8 | |
| - version: 8.4 | |
| swoole: v6.0.2 | |
| platform: | |
| - arch: amd64 | |
| runner: ubuntu-24.04 | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.platform.runner }} | |
| name: "Build ${{ matrix.php.version }} ${{ matrix.platform.arch }}" | |
| timeout-minutes: 240 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: crazywhalecc/static-php-cli | |
| ref: 2.7.1 | |
| - name: Update Swoole version to ${{ matrix.php.swoole }} | |
| run: | | |
| sed -i '/"swoole": {/,/}/ s/"rev": "[^"]*"/"rev": "${{ matrix.php.swoole }}"/' config/source.json | |
| echo "Updated swoole rev to ${{ matrix.php.swoole }}" | |
| grep -A 5 -B 1 '"swoole"' config/source.json || echo "swoole not found in config file" | |
| - name: Update MongoDB driver to 1.x versions only | |
| run: | | |
| sed -i '/"mongodb": {/,/}/ s/"match": "[^"]*"/"match": "mongodb-1\\\\.[0-9]+\\\\.[0-9]+\\\\.tgz"/' config/source.json | |
| echo "Updated mongodb match to 1.x versions only" | |
| grep -A 5 -B 1 '"mongodb"' config/source.json || echo "mongodb not found in config file" | |
| - run: ./bin/spc-gnu-docker download --with-php=${{ matrix.php.version }} --for-extensions=${{ env.EXTENSIONS }},xdebug | |
| - run: ./bin/spc-gnu-docker build ${{ env.EXTENSIONS }} --enable-zts --build-cli --build-shared=xdebug | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: php${{ matrix.php.version }}-${{ matrix.platform.arch }} | |
| path: | | |
| buildroot/bin/php | |
| buildroot/modules/xdebug.so |