5
5
jobs :
6
6
build-php :
7
7
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 }}
10
10
strategy :
11
11
fail-fast : false
12
12
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
14
38
steps :
15
39
- name : Checkout
16
- uses : actions/checkout@v3
40
+ uses : actions/checkout@v4
17
41
18
42
- name : Set up Docker Buildx
19
43
uses : docker/setup-buildx-action@v1
20
44
21
45
- name : Cache Docker layers
22
- uses : actions/cache@v2
46
+ uses : actions/cache@v4
23
47
with :
24
48
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 }}
27
51
28
52
- name : Build
29
- uses : docker/build-push-action@v2
53
+ uses : docker/build-push-action@v6
30
54
with :
31
55
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 }}
34
60
cache-from : type=local,src=/tmp/.buildx-cache
35
61
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
37
63
38
64
# https://github.com/docker/build-push-action/issues/252
39
65
- name : Move build cache
@@ -45,10 +71,10 @@ jobs:
45
71
env :
46
72
PHP_VERSION : ${{ matrix.php-versions }}
47
73
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
50
76
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
52
78
53
79
- name : Package and ship artifact to releases
54
80
run : bash scripts/build.sh ship
@@ -60,10 +86,10 @@ jobs:
60
86
USER : ${{ github.repository_owner }}
61
87
62
88
- name : Upload artifact to workflow
63
- uses : actions/upload-artifact@v2
89
+ uses : actions/upload-artifact@v4
64
90
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
67
93
test :
68
94
needs : build-php
69
95
if : ${{ always() }}
@@ -72,17 +98,19 @@ jobs:
72
98
strategy :
73
99
fail-fast : false
74
100
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 ]
77
103
steps :
78
104
- name : Checkout
79
- uses : actions/checkout@v3
105
+ uses : actions/checkout@v4
80
106
81
107
- name : Stage PHP
82
108
run : |
83
109
bash scripts/version-files.sh ${{ matrix.php-versions }}
84
110
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 }}
86
114
env :
87
115
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88
116
@@ -126,14 +154,15 @@ jobs:
126
154
name : Update dist
127
155
if : " !contains(github.event.head_commit.message, 'skip-release')"
128
156
needs : [build-php, test]
129
- runs-on : ubuntu-latest
157
+ runs-on : ${{ matrix.os }}
130
158
strategy :
131
159
fail-fast : false
132
160
matrix :
133
161
php-versions : ['5.3', '5.4', '5.5']
162
+ os : [ubuntu-24.04, ubuntu-24.04-arm]
134
163
steps :
135
164
- name : Checkout
136
- uses : actions/checkout@v3
165
+ uses : actions/checkout@v4
137
166
- name : Add ZSTD
138
167
env :
139
168
REPO : ${{ github.repository }}
@@ -145,29 +174,32 @@ jobs:
145
174
mkdir builds
146
175
bash scripts/version-files.sh "$PHP_VERSION"
147
176
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/
152
183
env :
153
184
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154
185
PHP_VERSION : ${{ matrix.php-versions }}
155
186
- name : Upload Artifact
156
- uses : actions/upload-artifact@v2
187
+ uses : actions/upload-artifact@v4
157
188
with :
158
- name : builds
189
+ name : builds-${{ matrix.php-versions }}-${{ matrix.os }}
159
190
path : builds
160
191
release :
161
192
runs-on : ubuntu-latest
162
193
if : " !contains(github.event.head_commit.message, 'skip-release')"
163
194
needs : [build-php, test, package]
164
195
steps :
165
- - uses : actions/checkout@v3
196
+ - uses : actions/checkout@v4
166
197
- run : mkdir builds
167
- - uses : actions/download-artifact@v2
198
+ - uses : actions/download-artifact@v4
168
199
with :
169
- name : builds
200
+ pattern : builds-*
170
201
path : builds
202
+ merge-multiple : true
171
203
- name : Release
172
204
run : |
173
205
set -x
0 commit comments