2929 description : Extensions to build (comma separated)
3030 required : true
3131 type : string
32+ shared-extensions :
33+ description : Shared extensions to build (optional, comma separated)
34+ type : string
3235 extra-libs :
3336 description : Extra libraries to build (optional, comma separated)
3437 type : string
4245 build-fpm :
4346 description : Build fpm binary
4447 type : boolean
48+ build-frankenphp :
49+ description : Build frankenphp binary (requires ZTS)
50+ type : boolean
51+ default : false
52+ enable-zts :
53+ description : Enable ZTS
54+ type : boolean
55+ default : false
4556 prefer-pre-built :
4657 description : Prefer pre-built binaries (reduce build time)
4758 type : boolean
4859 default : true
60+ with-suggested-libs :
61+ description : Build with suggested libs
62+ type : boolean
63+ default : true
4964 debug :
5065 description : Show full build logs
5166 type : boolean
6984 description : Extensions to build (comma separated)
7085 required : true
7186 type : string
87+ shared-extensions :
88+ description : Shared extensions to build (optional, comma separated)
89+ type : string
7290 extra-libs :
7391 description : Extra libraries to build (optional, comma separated)
7492 type : string
82100 build-fpm :
83101 description : Build fpm binary
84102 type : boolean
103+ build-frankenphp :
104+ description : Build frankenphp binary (requires ZTS)
105+ type : boolean
106+ default : false
107+ enable-zts :
108+ description : Enable ZTS
109+ type : boolean
110+ default : false
85111 prefer-pre-built :
86112 description : Prefer pre-built binaries (reduce build time)
87113 type : boolean
88114 default : true
115+ with-suggested-libs :
116+ description : Include suggested libs
117+ type : boolean
118+ default : false
89119 debug :
90120 description : Show full build logs
91121 type : boolean
@@ -144,8 +174,19 @@ jobs:
144174 RUNS_ON="macos-15"
145175 ;;
146176 esac
147- DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=${{ inputs.extensions }} --ignore-cache-sources=php-src"
148- BUILD_CMD="$BUILD_CMD ${{ inputs.extensions }}"
177+ STATIC_EXTS="${{ inputs.extensions }}"
178+ SHARED_EXTS="${{ inputs['shared-extensions'] }}"
179+ BUILD_FRANKENPHP="${{ inputs['build-frankenphp'] }}"
180+ ENABLE_ZTS="${{ inputs['enable-zts'] }}"
181+ ALL_EXTS="$STATIC_EXTS"
182+ if [ -n "$SHARED_EXTS" ]; then
183+ ALL_EXTS="$ALL_EXTS,$SHARED_EXTS"
184+ fi
185+ DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=$ALL_EXTS --ignore-cache-sources=php-src"
186+ BUILD_CMD="$BUILD_CMD $STATIC_EXTS"
187+ if [ -n "$SHARED_EXTS" ]; then
188+ BUILD_CMD="$BUILD_CMD --build-shared=$SHARED_EXTS"
189+ fi
149190 if [ -n "${{ inputs.extra-libs }}" ]; then
150191 DOWN_CMD="$DOWN_CMD --for-libs=${{ inputs.extra-libs }}"
151192 BUILD_CMD="$BUILD_CMD --with-libs=${{ inputs.extra-libs }}"
@@ -157,6 +198,9 @@ jobs:
157198 if [ ${{ inputs.prefer-pre-built }} == true ]; then
158199 DOWN_CMD="$DOWN_CMD --prefer-pre-built"
159200 fi
201+ if [ ${{ inputs.with-suggested-libs }} == true ]; then
202+ BUILD_CMD="$BUILD_CMD --with-suggested-libs"
203+ fi
160204 if [ ${{ inputs.build-cli }} == true ]; then
161205 BUILD_CMD="$BUILD_CMD --build-cli"
162206 fi
@@ -166,6 +210,12 @@ jobs:
166210 if [ ${{ inputs.build-fpm }} == true ]; then
167211 BUILD_CMD="$BUILD_CMD --build-fpm"
168212 fi
213+ if [ "$BUILD_FRANKENPHP" = "true" ]; then
214+ BUILD_CMD="$BUILD_CMD --build-frankenphp"
215+ fi
216+ if [ "$ENABLE_ZTS" = "true" ]; then
217+ BUILD_CMD="$BUILD_CMD --enable-zts"
218+ fi
169219 echo 'download='"$DOWN_CMD" >> "$GITHUB_OUTPUT"
170220 echo 'build='"$BUILD_CMD" >> "$GITHUB_OUTPUT"
171221 echo 'run='"$RUNS_ON" >> "$GITHUB_OUTPUT"
@@ -188,6 +238,27 @@ jobs:
188238 env :
189239 phpts : nts
190240
241+ - if : ${{ inputs['build-frankenphp'] == true }}
242+ name : " Install go-xcaddy for FrankenPHP"
243+ run : |
244+ case "${{ inputs.os }}" in
245+ linux-x86_64|linux-aarch64)
246+ ./bin/spc-alpine-docker install-pkg go-xcaddy
247+ ;;
248+ linux-x86_64-glibc|linux-aarch64-glibc)
249+ ./bin/spc-gnu-docker install-pkg go-xcaddy
250+ ;;
251+ macos-x86_64|macos-aarch64)
252+ composer update --no-dev --classmap-authoritative
253+ ./bin/spc doctor --auto-fix
254+ ./bin/spc install-pkg go-xcaddy
255+ ;;
256+ *)
257+ echo "Unsupported OS for go-xcaddy install: ${{ inputs.os }}"
258+ exit 1
259+ ;;
260+ esac
261+
191262 # Cache downloaded source
192263 - id : cache-download
193264 uses : actions/cache@v4
@@ -202,37 +273,60 @@ jobs:
202273# if: ${{ failure() }}
203274# uses: mxschmitt/action-tmate@v3
204275
276+ # Upload debug logs
277+ - if : ${{ inputs.debug && failure() }}
278+ name : " Upload build logs on failure"
279+ uses : actions/upload-artifact@v7
280+ with :
281+ name : spc-logs-${{ inputs.php-version }}-${{ inputs.os }}
282+ path : log/*.log
283+
205284 # Upload cli executable
206285 - if : ${{ inputs.build-cli == true }}
207286 name : " Upload PHP cli SAPI"
208- uses : actions/upload-artifact@v4
287+ uses : actions/upload-artifact@v7
209288 with :
210289 name : php-cli-${{ inputs.php-version }}-${{ inputs.os }}
211290 path : buildroot/bin/php
212291
213292 # Upload micro self-extracted executable
214293 - if : ${{ inputs.build-micro == true }}
215294 name : " Upload PHP micro SAPI"
216- uses : actions/upload-artifact@v4
295+ uses : actions/upload-artifact@v7
217296 with :
218297 name : php-micro-${{ inputs.php-version }}-${{ inputs.os }}
219298 path : buildroot/bin/micro.sfx
220299
221300 # Upload fpm executable
222301 - if : ${{ inputs.build-fpm == true }}
223302 name : " Upload PHP fpm SAPI"
224- uses : actions/upload-artifact@v4
303+ uses : actions/upload-artifact@v7
225304 with :
226305 name : php-fpm-${{ inputs.php-version }}-${{ inputs.os }}
227306 path : buildroot/bin/php-fpm
228307
308+ # Upload frankenphp executable
309+ - if : ${{ inputs['build-frankenphp'] == true }}
310+ name : " Upload FrankenPHP SAPI"
311+ uses : actions/upload-artifact@v7
312+ with :
313+ name : php-frankenphp-${{ inputs.php-version }}-${{ inputs.os }}
314+ path : buildroot/bin/frankenphp
315+
229316 # Upload extensions metadata
230- - uses : actions/upload-artifact@v4
317+ - if : ${{ inputs['shared-extensions'] != '' }}
318+ name : " Upload shared extensions"
319+ uses : actions/upload-artifact@v7
320+ with :
321+ name : php-shared-ext-${{ inputs.php-version }}-${{ inputs.os }}
322+ path : |
323+ buildroot/modules/*.so
324+ - uses : actions/upload-artifact@v7
231325 name : " Upload License Files"
232326 with :
233327 name : license-files-${{ inputs.php-version }}-${{ inputs.os }}
234328 path : buildroot/license/
235- - uses : actions/upload-artifact@v4
329+ - uses : actions/upload-artifact@v7
236330 name : " Upload Build Metadata"
237331 with :
238332 name : build-meta-${{ inputs.php-version }}-${{ inputs.os }}
0 commit comments