@@ -50,54 +50,19 @@ jobs:
5050 php85_version : ${{ steps.check.outputs.php85_version }}
5151 skip : ${{ steps.check.outputs.skip }}
5252 ref : ${{ steps.check.outputs.ref || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}
53+ base_fingerprint : ${{ steps.check.outputs.base_fingerprint }}
5354 steps :
54- - name : Check PHP versions
55- id : check
56- env :
57- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58- run : |
59- PHP_82_LATEST=$(skopeo inspect docker://docker.io/library/php:8.2 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
60- PHP_83_LATEST=$(skopeo inspect docker://docker.io/library/php:8.3 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
61- PHP_84_LATEST=$(skopeo inspect docker://docker.io/library/php:8.4 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
62- PHP_85_LATEST=$(skopeo inspect docker://docker.io/library/php:8.5 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
63- {
64- echo php_version="${PHP_82_LATEST},${PHP_83_LATEST},${PHP_84_LATEST},${PHP_85_LATEST}"
65- echo php82_version="${PHP_82_LATEST//./-}"
66- echo php83_version="${PHP_83_LATEST//./-}"
67- echo php84_version="${PHP_84_LATEST//./-}"
68- echo php85_version="${PHP_85_LATEST//./-}"
69- } >> "${GITHUB_OUTPUT}"
70-
71- # Check if the Docker images must be rebuilt
72- if [[ "${GITHUB_EVENT_NAME}" != "schedule" ]]; then
73- echo skip=false >> "${GITHUB_OUTPUT}"
74- exit 0
75- fi
76-
77- FRANKENPHP_LATEST_TAG=$(gh release view --repo php/frankenphp --json tagName --jq '.tagName')
78- FRANKENPHP_LATEST_TAG_NO_PREFIX="${FRANKENPHP_LATEST_TAG#v}"
79- FRANKENPHP_82_LATEST=$(skopeo inspect docker://docker.io/dunglas/frankenphp:"${FRANKENPHP_LATEST_TAG_NO_PREFIX}"-php8.2 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
80- FRANKENPHP_83_LATEST=$(skopeo inspect docker://docker.io/dunglas/frankenphp:"${FRANKENPHP_LATEST_TAG_NO_PREFIX}"-php8.3 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
81- FRANKENPHP_84_LATEST=$(skopeo inspect docker://docker.io/dunglas/frankenphp:"${FRANKENPHP_LATEST_TAG_NO_PREFIX}"-php8.4 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
82- FRANKENPHP_85_LATEST=$(skopeo inspect docker://docker.io/dunglas/frankenphp:"${FRANKENPHP_LATEST_TAG_NO_PREFIX}"-php8.5 --override-os linux --override-arch amd64 | jq -r '.Env[] | select(test("^PHP_VERSION=")) | sub("^PHP_VERSION="; "")')
83-
84- if [[ "${FRANKENPHP_82_LATEST}" == "${PHP_82_LATEST}" ]] && [[ "${FRANKENPHP_83_LATEST}" == "${PHP_83_LATEST}" ]] && [[ "${FRANKENPHP_84_LATEST}" == "${PHP_84_LATEST}" ]] && [[ "${FRANKENPHP_85_LATEST}" == "${PHP_85_LATEST}" ]]; then
85- echo skip=true >> "${GITHUB_OUTPUT}"
86- exit 0
87- fi
88-
89- {
90- echo ref="${FRANKENPHP_LATEST_TAG}"
91- echo skip=false
92- } >> "${GITHUB_OUTPUT}"
9355 - uses : actions/checkout@v6
94- if : ${{ !fromJson(steps.check.outputs.skip) }}
9556 with :
96- ref : ${{ steps.check.outputs.ref }}
57+ fetch-depth : 0
9758 persist-credentials : false
9859 - name : Set up Docker Buildx
99- if : ${{ !fromJson(steps.check.outputs.skip) }}
10060 uses : docker/setup-buildx-action@v3
61+ - name : Check PHP versions and base image fingerprint
62+ id : check
63+ env :
64+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
65+ run : ./scripts/ci/compute-fingerprint.sh
10166 - name : Create variants matrix
10267 if : ${{ !fromJson(steps.check.outputs.skip) }}
10368 id : matrix
@@ -192,6 +157,7 @@ jobs:
192157 SHA : ${{ github.sha }}
193158 VERSION : ${{ (github.ref_type == 'tag' && github.ref_name) || needs.prepare.outputs.ref || 'dev' }}
194159 PHP_VERSION : ${{ needs.prepare.outputs.php_version }}
160+ BASE_FINGERPRINT : ${{ needs.prepare.outputs.base_fingerprint }}
195161 - # Workaround for https://github.com/actions/runner/pull/2477#issuecomment-1501003600
196162 name : Export metadata
197163 if : fromJson(needs.prepare.outputs.push)
0 commit comments