|
| 1 | +name: Custom Build FrankenPHP |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-frankenphp: |
| 8 | + name: Build FrankenPHP with Custom Extensions |
| 9 | + runs-on: self-hosted |
| 10 | + |
| 11 | + steps: |
| 12 | + - name: Checkout repository |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - name: Clean workspace |
| 16 | + run: | |
| 17 | + rm -rf spc spc.tgz buildroot downloads source |
| 18 | +
|
| 19 | + - name: Download SPC binary |
| 20 | + run: | |
| 21 | + curl -fsSL -o spc.tgz https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64.tar.gz && tar -zxvf spc.tgz && rm spc.tgz |
| 22 | + chmod +x ./spc |
| 23 | + ./spc --version |
| 24 | +
|
| 25 | + - name: Download sources by extensions |
| 26 | + run: | |
| 27 | + ./spc download \ |
| 28 | + --with-php=8.4 \ |
| 29 | + --for-extensions "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,igbinary,intl,mbregex,mbstring,msgpack,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib" \ |
| 30 | + --prefer-pre-built \ |
| 31 | + --debug |
| 32 | +
|
| 33 | + - name: Install UPX |
| 34 | + run: | |
| 35 | + ./spc install-pkg upx --debug |
| 36 | +
|
| 37 | + - name: Install go-xcaddy for FrankenPHP |
| 38 | + run: | |
| 39 | + ./spc install-pkg go-xcaddy --debug |
| 40 | +
|
| 41 | + - name: Auto-check and prepare build environment |
| 42 | + run: | |
| 43 | + ./spc doctor --auto-fix --debug |
| 44 | +
|
| 45 | + - name: Build FrankenPHP |
| 46 | + run: | |
| 47 | + ./spc build \ |
| 48 | + --build-frankenphp "apcu,bcmath,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,igbinary,intl,mbregex,mbstring,msgpack,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib" \ |
| 49 | + --with-libs="libavif,libjpeg,libwebp" \ |
| 50 | + --debug \ |
| 51 | + --enable-zts \ |
| 52 | + --with-upx-pack \ |
| 53 | + -I "memory_limit=512M" \ |
| 54 | + -I "opcache.jit=tracing" \ |
| 55 | + -I "opcache.jit_buffer_size=128M" \ |
| 56 | + -I "max_execution_time = 60" \ |
| 57 | + -I "max_input_time = 60" \ |
| 58 | + -I "post_max_size = 100M" \ |
| 59 | + -I "upload_max_filesize = 10M" \ |
| 60 | + -I "max_file_uploads = 20" \ |
| 61 | + -I "max_input_vars = 3000" |
| 62 | +
|
| 63 | + - name: Verify build output |
| 64 | + run: | |
| 65 | + ls -lah ./buildroot/bin/ |
| 66 | + if [ -f ./buildroot/bin/frankenphp ]; then |
| 67 | + echo "✅ FrankenPHP binary found" |
| 68 | + file ./buildroot/bin/frankenphp |
| 69 | + ./buildroot/bin/frankenphp version || true |
| 70 | + else |
| 71 | + echo "❌ FrankenPHP binary not found" |
| 72 | + exit 1 |
| 73 | + fi |
| 74 | +
|
| 75 | + - name: Upload FrankenPHP artifact |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: frankenphp |
| 79 | + path: ./buildroot/bin/frankenphp |
| 80 | + if-no-files-found: error |
| 81 | + retention-days: 30 |
| 82 | + |
| 83 | + - uses: actions/upload-artifact@v4 |
| 84 | + name: "Upload Build Metadata" |
| 85 | + with: |
| 86 | + name: build-meta |
| 87 | + path: | |
| 88 | + buildroot/build-extensions.json |
| 89 | + buildroot/build-libraries.json |
0 commit comments