1- name : Build PHP binaries
1+ name : Build and publish PHP binaries
22
33on :
44 push :
@@ -12,171 +12,21 @@ concurrency:
1212 cancel-in-progress : true
1313
1414jobs :
15- linux :
16- name : Linux (PM ${{ matrix.pm-version-major }})
15+ all-builds :
16+ name : PM ${{ matrix.pm-version-major }}
1717 runs-on : ubuntu-20.04
1818 strategy :
1919 matrix :
2020 pm-version-major : [4, 5]
2121
22- steps :
23- - uses : actions/checkout@v4
24-
25- - name : Install tools and dependencies
26- run : |
27- sudo apt-get update
28- sudo apt-get install make autoconf automake libtool libtool-bin m4 wget libc-bin gzip bzip2 bison g++ git re2c
29-
30- - name : Prepare compile.sh download cache
31- id : download-cache
32- uses : actions/cache@v4
33- with :
34- path : ./download_cache
35- key : compile-sh-cache-ssl-https-${{ hashFiles('./compile.sh') }}
36- restore-keys : compile-sh-cache-ssl-https-
37-
38- - name : Compile PHP
39- run : |
40- # Used "set -ex" instead of hashbang since script isn't executed with hashbang
41- set -ex
42- trap "exit 1" ERR
43- ./compile.sh -t linux64 -j 4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
44-
45- - name : Create tarball
46- run : |
47- tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
48- tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
49-
50- - name : Upload artifacts
51- uses : actions/upload-artifact@v4
52- if : always()
53- with :
54- name : Linux-PM${{ matrix.pm-version-major }}
55- path : |
56- ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}*.tar.gz
57- install.log
58- compile.sh
59- if-no-files-found : error
60-
61- - name : Prepare workspace for upload
62- if : failure()
63- run : tar -czf workspace.tar.gz install_data
64-
65- - name : Upload workspace
66- uses : actions/upload-artifact@v4
67- if : failure()
68- with :
69- name : Linux-workspace-PM${{ matrix.pm-version-major }}
70- path : |
71- workspace.tar.gz
72- if-no-files-found : error
73-
74- macos :
75- name : MacOS ${{ matrix.artifact-name }} (PM ${{ matrix.pm-version-major }})
76- runs-on : ${{ matrix.image }}
77- strategy :
78- matrix :
79- pm-version-major : [ 4, 5 ]
80- artifact-name : [x86_64, arm64]
81- include :
82- - target-name : mac-x86-64
83- artifact-name : x86_64
84- image : macos-12
85- - target-name : mac-arm64
86- artifact-name : arm64
87- image : macos-14
88-
89- steps :
90- - uses : actions/checkout@v4
91-
92- - name : Install tools and dependencies
93- run : brew install libtool autoconf automake pkg-config bison re2c
94-
95- - name : Prepare compile.sh download cache
96- id : download-cache
97- uses : actions/cache@v4
98- with :
99- path : ./download_cache
100- key : compile-sh-cache-ssl-https-${{ hashFiles('./compile.sh') }}
101- restore-keys : compile-sh-cache-ssl-https-
102-
103- - name : Compile PHP
104- run : |
105- export PATH="/usr/local/opt/bison/bin:$PATH"
106- set -ex
107- trap "exit 1" ERR
108- ./compile.sh -t ${{ matrix.target-name }} -j4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
109-
110- - name : Create tarball
111- run : |
112- tar -czf ./PHP-MacOS-${{ matrix.artifact-name }}-PM${{ matrix.pm-version-major }}.tar.gz bin
113- tar -czf ./PHP-MacOS-${{ matrix.artifact-name }}-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
114-
115- - name : Upload artifacts
116- uses : actions/upload-artifact@v4
117- if : always()
118- with :
119- name : MacOS-${{ matrix.artifact-name }}-PM${{ matrix.pm-version-major }}
120- path : |
121- ./PHP-MacOS-${{ matrix.artifact-name}}-PM${{ matrix.pm-version-major }}*.tar.gz
122- install.log
123- compile.sh
124- if-no-files-found : error
125-
126- - name : Prepare workspace for upload
127- if : failure()
128- run : tar -czf workspace.tar.gz install_data
129-
130- - name : Upload workspace
131- uses : actions/upload-artifact@v4
132- if : failure()
133- with :
134- name : MacOS-${{ matrix.artifact-name }}-workspace-PM${{ matrix.pm-version-major }}
135- path : |
136- workspace.tar.gz
137- if-no-files-found : error
138-
139- windows :
140- name : Windows (PM ${{ matrix.pm-version-major }})
141- runs-on : windows-2019
142- strategy :
143- matrix :
144- pm-version-major : [ 4, 5 ]
145-
146- steps :
147- - uses : actions/checkout@v4
148-
149- - name : Install tools and dependencies
150- run : choco install wget --no-progress
151-
152- - name : Compile PHP
153- run : .\windows-compile-vs.bat
154- env :
155- VS_EDITION : Enterprise
156- SOURCES_PATH : ${{ github.workspace }}\pocketmine-php-sdk
157- PM_VERSION_MAJOR : ${{ matrix.pm-version-major }}
158-
159- - name : Rename artifacts
160- run : |
161- mkdir temp
162- move php-debug-pack-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}-debugging-symbols.zip
163- move php-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}.zip
164- move temp\*.zip .
165-
166- - name : Upload artifacts
167- uses : actions/upload-artifact@v4
168- if : always()
169- with :
170- name : Windows-PM${{ matrix.pm-version-major }}
171- path : |
172- PHP-Windows-x64*.zip
173- compile.log
174- windows-compile-vs.bat
175- if-no-files-found : error
22+ uses : ./.github/workflows/main-pm-matrix.yml
23+ with :
24+ pm-version-major : ${{ matrix.pm-version-major }}
25+ secrets : inherit
17626
17727 publish :
17828 name : Publish binaries
179- needs : [linux, macos, windows ]
29+ needs : [all-builds ]
18030 runs-on : ubuntu-20.04
18131 if : ${{ startsWith(github.ref_name, 'php/') && github.ref_type == 'branch' && !contains(github.event.head_commit.message, '[no release]') }}
18232
0 commit comments