55jobs :
66 build-php :
77 if : " !contains(github.event.head_commit.message, 'skip-build-php')"
8- name : Build PHP ${{ matrix.php-versions }}
9- runs-on : ubuntu-latest
8+ name : Build PHP ${{ matrix.php-versions }} on ${{ matrix.containers }}
9+ runs-on : ${{ matrix.os }}
1010 strategy :
1111 fail-fast : false
1212 matrix :
13- php-versions : [5.3, 5.4, 5.5]
13+ include :
14+ - php-versions : 5.3
15+ containers : ubuntu:trusty
16+ arch-suffix : ' '
17+ os : ubuntu-24.04
18+ - php-versions : 5.4
19+ containers : ubuntu:trusty
20+ arch-suffix : ' '
21+ os : ubuntu-24.04
22+ - php-versions : 5.5
23+ containers : ubuntu:trusty
24+ arch-suffix : ' '
25+ os : ubuntu-24.04
26+ - php-versions : 5.3
27+ containers : arm64v8/ubuntu:trusty
28+ arch-suffix : ' -arm64'
29+ os : ubuntu-24.04-arm
30+ - php-versions : 5.4
31+ containers : arm64v8/ubuntu:trusty
32+ arch-suffix : ' -arm64'
33+ os : ubuntu-24.04-arm
34+ - php-versions : 5.5
35+ containers : arm64v8/ubuntu:trusty
36+ arch-suffix : ' -arm64'
37+ os : ubuntu-24.04-arm
1438 steps :
1539 - name : Checkout
16- uses : actions/checkout@v3
40+ uses : actions/checkout@v4
1741
1842 - name : Set up Docker Buildx
1943 uses : docker/setup-buildx-action@v1
2044
2145 - name : Cache Docker layers
22- uses : actions/cache@v2
46+ uses : actions/cache@v4
2347 with :
2448 path : /tmp/.buildx-cache
25- key : ${{ runner.os }}-docker-php-${{ matrix.php-versions }}-${{ github.run_id }}-${{ github.run_number }}
26- restore-keys : ${{ runner.os }}-docker-php-${{ matrix.php-versions }}
49+ key : ${{ runner.os }}-docker-php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}-${{ matrix.os }} -${{ github.run_id }}-${{ github.run_number }}
50+ restore-keys : ${{ runner.os }}-docker-php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}-${{ matrix.os }}
2751
2852 - name : Build
29- uses : docker/build-push-action@v2
53+ uses : docker/build-push-action@v6
3054 with :
3155 context : .
32- tags : php-${{ matrix.php-versions }}
33- build-args : PHP_VERSION=${{ matrix.php-versions }}
56+ tags : php-${{ matrix.php-versions }}${{ matrix.arch-suffix }}
57+ build-args : |
58+ PHP_VERSION=${{ matrix.php-versions }}
59+ UBUNTU_VERSION=${{ matrix.containers }}
3460 cache-from : type=local,src=/tmp/.buildx-cache
3561 cache-to : type=local,dest=/tmp/.buildx-cache-new
36- outputs : type=docker,dest=/tmp/php-${{ matrix.php-versions }}.tar
62+ outputs : type=docker,dest=/tmp/php-${{ matrix.php-versions }}${{ matrix.arch-suffix }} .tar
3763
3864 # https://github.com/docker/build-push-action/issues/252
3965 - name : Move build cache
@@ -45,10 +71,10 @@ jobs:
4571 env :
4672 PHP_VERSION : ${{ matrix.php-versions }}
4773 run : |
48- docker load --input /tmp/php-$PHP_VERSION.tar
49- docker run --name=php-$PHP_VERSION php-$PHP_VERSION sh -c exit
74+ docker load --input /tmp/php-$PHP_VERSION${{ matrix.arch-suffix }} .tar
75+ docker run --name=php-$PHP_VERSION${{ matrix.arch-suffix }} php-$PHP_VERSION${{ matrix.arch-suffix }} sh -c exit
5076 sudo chmod 777 /usr/local
51- docker cp php-$PHP_VERSION:/usr/local/php /usr/local/php
77+ docker cp php-$PHP_VERSION${{ matrix.arch-suffix }} :/usr/local/php /usr/local/php
5278
5379 - name : Package and ship artifact to releases
5480 run : bash scripts/build.sh ship
@@ -60,10 +86,10 @@ jobs:
6086 USER : ${{ github.repository_owner }}
6187
6288 - name : Upload artifact to workflow
63- uses : actions/upload-artifact@v2
89+ uses : actions/upload-artifact@v4
6490 with :
65- name : php${{ matrix.php-versions }}
66- path : ${{ github.workspace }}/php-${{ matrix.php-versions }}-build.tar.zst
91+ name : php${{ matrix.php-versions }}${{ matrix.arch-suffix }}
92+ path : ${{ github.workspace }}/php-${{ matrix.php-versions }}-build${{ matrix.arch-suffix }} .tar.zst
6793 test :
6894 needs : build-php
6995 if : ${{ always() }}
@@ -72,17 +98,19 @@ jobs:
7298 strategy :
7399 fail-fast : false
74100 matrix :
75- operating-system : [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04 ]
76- php-versions : ['5.3', '5.4', '5.5' ]
101+ php-versions : [5.3, 5.4, 5.5 ]
102+ operating-system : [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, ubuntu-22.04-arm, ubuntu-24.04-arm ]
77103 steps :
78104 - name : Checkout
79- uses : actions/checkout@v3
105+ uses : actions/checkout@v4
80106
81107 - name : Stage PHP
82108 run : |
83109 bash scripts/version-files.sh ${{ matrix.php-versions }}
84110 bash scripts/stage.sh ${{ matrix.php-versions }}
85- gh release download -p 'php-${{ matrix.php-versions }}-build.tar.zst' -D php-${{ matrix.php-versions }}
111+ arch="$(arch)"
112+ [[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
113+ gh release download -p "php-${{ matrix.php-versions }}-build$arch_suffix.tar.zst" -D php-${{ matrix.php-versions }}
86114 env :
87115 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88116
@@ -126,14 +154,15 @@ jobs:
126154 name : Update dist
127155 if : " !contains(github.event.head_commit.message, 'skip-release')"
128156 needs : [build-php, test]
129- runs-on : ubuntu-latest
157+ runs-on : ${{ matrix.os }}
130158 strategy :
131159 fail-fast : false
132160 matrix :
133161 php-versions : ['5.3', '5.4', '5.5']
162+ os : [ubuntu-24.04, ubuntu-24.04-arm]
134163 steps :
135164 - name : Checkout
136- uses : actions/checkout@v3
165+ uses : actions/checkout@v4
137166 - name : Add ZSTD
138167 env :
139168 REPO : ${{ github.repository }}
@@ -145,29 +174,32 @@ jobs:
145174 mkdir builds
146175 bash scripts/version-files.sh "$PHP_VERSION"
147176 bash scripts/stage.sh "$PHP_VERSION"
148- gh release download -p php-"$PHP_VERSION"-build.tar.zst -D php-"$PHP_VERSION"
149- sudo XZ_OPT=-e9 tar cfJ php-"$PHP_VERSION".tar.xz php-"$PHP_VERSION"
150- sudo tar cf - php-"$PHP_VERSION" | zstd -22 -T0 --ultra > php-"$PHP_VERSION".tar.zst
151- mv php-"$PHP_VERSION".tar.* ./builds/
177+ arch="$(arch)"
178+ [[ "$arch" = "arm64" || "$arch" = "aarch64" ]] && arch_suffix="-arm64" || arch_suffix=""
179+ gh release download -p php-"$PHP_VERSION"-build"$arch_suffix".tar.zst -D php-"$PHP_VERSION"
180+ sudo XZ_OPT=-e9 tar cfJ php-"$PHP_VERSION$arch_suffix".tar.xz php-"$PHP_VERSION"
181+ sudo tar cf - php-"$PHP_VERSION" | zstd -22 -T0 --ultra > php-"$PHP_VERSION$arch_suffix".tar.zst
182+ mv php-"$PHP_VERSION$arch_suffix".tar.* ./builds/
152183 env :
153184 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154185 PHP_VERSION : ${{ matrix.php-versions }}
155186 - name : Upload Artifact
156- uses : actions/upload-artifact@v2
187+ uses : actions/upload-artifact@v4
157188 with :
158- name : builds
189+ name : builds-${{ matrix.php-versions }}-${{ matrix.os }}
159190 path : builds
160191 release :
161192 runs-on : ubuntu-latest
162193 if : " !contains(github.event.head_commit.message, 'skip-release')"
163194 needs : [build-php, test, package]
164195 steps :
165- - uses : actions/checkout@v3
196+ - uses : actions/checkout@v4
166197 - run : mkdir builds
167- - uses : actions/download-artifact@v2
198+ - uses : actions/download-artifact@v4
168199 with :
169- name : builds
200+ pattern : builds-*
170201 path : builds
202+ merge-multiple : true
171203 - name : Release
172204 run : |
173205 set -x
0 commit comments