@@ -456,7 +456,7 @@ jobs:
456456 MUSL_SHA256 : a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4
457457 MUSL_VERSION : ' 1.2.5'
458458 NATIVE_PREREQUISITE_CACHE_SCHEMA : ' v1'
459- PHP_VERSION : ' 8.4.23 '
459+ PHP_VERSION : ' 8.4.27 '
460460 PHPMICRO_CACHE_SCHEMA : ' v1'
461461 PHPMICRO_UNCACHED_BASELINE_SECONDS : ' 480'
462462 SPC_DOWNLOAD_OUTER_ATTEMPTS : ' 4'
@@ -479,6 +479,8 @@ jobs:
479479 sparse-checkout : |
480480 .github/workflows/release.yml
481481 scripts/ci/establish-native-prerequisites.sh
482+ scripts/ci/probe-standalone-runtime.php
483+ scripts/ci/verify-standalone-runtime.js
482484 sparse-checkout-cone-mode : false
483485
484486 - name : Download PHAR artifact
@@ -804,6 +806,23 @@ jobs:
804806 "sha256=$micro_sha256" \
805807 > phpmicro-cache.manifest
806808
809+ - name : Verify produced standalone PHP runtime
810+ id : runtime-policy
811+ timeout-minutes : 2
812+ shell : bash
813+ working-directory : build/.tools
814+ run : |
815+ set -euo pipefail
816+ policy="$GITHUB_WORKSPACE/release-toolchain-control/scripts/ci"
817+ ./spc micro:combine "$policy/probe-standalone-runtime.php" \
818+ --output=standalone-runtime-probe
819+ chmod +x standalone-runtime-probe
820+ ./standalone-runtime-probe > standalone-runtime.json
821+ node "$policy/verify-standalone-runtime.js" --expected-version "$PHP_VERSION" \
822+ < standalone-runtime.json > standalone-runtime-verification.json
823+ cat standalone-runtime-verification.json
824+ rm standalone-runtime-probe
825+
807826 - name : Record phpmicro toolchain timing
808827 if : always()
809828 working-directory : build/.tools
@@ -820,6 +839,7 @@ jobs:
820839 NATIVE_PREREQUISITE_IDENTITY : ${{ steps.native-prerequisites.outputs.identity }}
821840 NATIVE_PREREQUISITE_MODE : ${{ steps.native-prerequisites.outputs.mode }}
822841 NATIVE_PREREQUISITE_SOURCE : ${{ steps.native-prerequisites.outputs.source }}
842+ RUNTIME_POLICY_OUTCOME : ${{ steps.runtime-policy.outcome }}
823843 run : |
824844 set -euo pipefail
825845 finished_at="$(date +%s)"
@@ -831,7 +851,8 @@ jobs:
831851 cache_mode="cold-fallback"
832852 fi
833853 outcome="failure"
834- if [ -s buildroot/bin/micro.sfx ] && [ -s phpmicro-cache.manifest ]; then
854+ if [ "$RUNTIME_POLICY_OUTCOME" = "success" ] &&
855+ [ -s buildroot/bin/micro.sfx ] && [ -s phpmicro-cache.manifest ]; then
835856 outcome="success"
836857 fi
837858
@@ -903,6 +924,8 @@ jobs:
903924 build/.tools/log/
904925 build/.tools/native-prerequisite-evidence.json
905926 build/.tools/phpmicro-timing.json
927+ build/.tools/standalone-runtime.json
928+ build/.tools/standalone-runtime-verification.json
906929 if-no-files-found : warn
907930
908931 - name : Combine PHAR into standalone binary
@@ -988,7 +1011,7 @@ jobs:
9881011 runs-on : windows-2022
9891012 env :
9901013 GITHUB_TOKEN : ${{ github.token }}
991- PHP_VERSION_WINDOWS : ' 8.4.23 '
1014+ PHP_VERSION_WINDOWS : ' 8.4.27 '
9921015 PHPMICRO_CACHE_SCHEMA : ' v1'
9931016 PHPMICRO_UNCACHED_BASELINE_SECONDS : ' 480'
9941017 SPC_DOWNLOAD_OUTER_ATTEMPTS : ' 4'
@@ -1011,7 +1034,10 @@ jobs:
10111034 ref : ${{ needs.resolve-release.outputs.control_commit }}
10121035 path : release-toolchain-control
10131036 persist-credentials : false
1014- sparse-checkout : .github/workflows/release.yml
1037+ sparse-checkout : |
1038+ .github/workflows/release.yml
1039+ scripts/ci/probe-standalone-runtime.php
1040+ scripts/ci/verify-standalone-runtime.js
10151041 sparse-checkout-cone-mode : false
10161042
10171043 - name : Download PHAR artifact
@@ -1328,6 +1354,34 @@ jobs:
13281354 "sha256=$microSha256"
13291355 ) | Set-Content -Path phpmicro-cache.manifest -Encoding ascii
13301356
1357+ - name : Verify produced standalone PHP runtime
1358+ id : runtime-policy
1359+ timeout-minutes : 2
1360+ shell : pwsh
1361+ working-directory : build\.tools
1362+ run : |
1363+ $ErrorActionPreference = "Stop"
1364+ $policy = Join-Path $env:GITHUB_WORKSPACE "release-toolchain-control\scripts\ci"
1365+ $probe = Join-Path $policy "probe-standalone-runtime.php"
1366+ $verifier = Join-Path $policy "verify-standalone-runtime.js"
1367+ $runtimeProbe = Join-Path (Get-Location).Path "standalone-runtime-probe.exe"
1368+ .\spc.exe micro:combine $probe --output=$runtimeProbe
1369+ if ($LASTEXITCODE -ne 0) {
1370+ throw "Could not package the produced-runtime probe"
1371+ }
1372+ $evidence = & $runtimeProbe
1373+ if ($LASTEXITCODE -ne 0) {
1374+ throw "The produced-runtime probe failed"
1375+ }
1376+ $evidence | Set-Content -Path standalone-runtime.json -Encoding utf8
1377+ $evidence | node $verifier --expected-version "$env:PHP_VERSION_WINDOWS" `
1378+ > standalone-runtime-verification.json
1379+ if ($LASTEXITCODE -ne 0) {
1380+ throw "The produced runtime failed the PHP release policy"
1381+ }
1382+ Get-Content -Raw standalone-runtime-verification.json
1383+ Remove-Item -Force $runtimeProbe
1384+
13311385 - name : Record phpmicro toolchain timing
13321386 if : always()
13331387 shell : pwsh
@@ -1341,6 +1395,7 @@ jobs:
13411395 PLATFORM : windows-x86_64
13421396 RUN_PURPOSE : ${{ needs.resolve-release.outputs.cache_warm == 'true' && 'cache-warm' || 'release' }}
13431397 STARTED_AT : ${{ steps.phpmicro-timing-start.outputs.started_at }}
1398+ RUNTIME_POLICY_OUTCOME : ${{ steps.runtime-policy.outcome }}
13441399 run : |
13451400 $finishedAt = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds()
13461401 $elapsedSeconds = $finishedAt - [long]$env:STARTED_AT
@@ -1351,7 +1406,8 @@ jobs:
13511406 $cacheMode = "cold-fallback"
13521407 }
13531408 $outcome = if (
1354- (Test-Path buildroot\bin\micro.sfx -PathType Leaf) `
1409+ $env:RUNTIME_POLICY_OUTCOME -eq "success" `
1410+ -and (Test-Path buildroot\bin\micro.sfx -PathType Leaf) `
13551411 -and (Test-Path phpmicro-cache.manifest -PathType Leaf)
13561412 ) { "success" } else { "failure" }
13571413
@@ -1386,6 +1442,8 @@ jobs:
13861442 path : |
13871443 build/.tools/log/
13881444 build/.tools/phpmicro-timing.json
1445+ build/.tools/standalone-runtime.json
1446+ build/.tools/standalone-runtime-verification.json
13891447 if-no-files-found : warn
13901448
13911449 - name : Combine PHAR into standalone binary
0 commit comments