1- name : Build PHP binaries
1+ name : Build and publish PHP binaries
22
33on :
44 push :
@@ -12,163 +12,20 @@ concurrency:
1212 cancel-in-progress : true
1313
1414jobs :
15- linux :
16- name : Linux (PM ${{ matrix.pm-version-major }})
17- runs-on : ubuntu-20.04
15+ all-builds :
16+ name : PM${{ matrix.pm-version-major }}
1817 strategy :
1918 matrix :
2019 pm-version-major : [4, 5]
2120
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@v3
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@v3
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@v3
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 (PM ${{ matrix.pm-version-major }})
76- runs-on : macos-11.0
77- strategy :
78- matrix :
79- pm-version-major : [ 4, 5 ]
80-
81- steps :
82- - uses : actions/checkout@v4
83-
84- - name : Install tools and dependencies
85- run : brew install libtool autoconf automake pkg-config bison re2c
86-
87- - name : Prepare compile.sh download cache
88- id : download-cache
89- uses : actions/cache@v3
90- with :
91- path : ./download_cache
92- key : compile-sh-cache-ssl-https-${{ hashFiles('./compile.sh') }}
93- restore-keys : compile-sh-cache-ssl-https-
94-
95- - name : Compile PHP
96- run : |
97- export PATH="/usr/local/opt/bison/bin:$PATH"
98- set -ex
99- trap "exit 1" ERR
100- ./compile.sh -t mac-x86-64 -j4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
101-
102- - name : Create tarball
103- run : |
104- tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
105- tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
106-
107- - name : Upload artifacts
108- uses : actions/upload-artifact@v3
109- if : always()
110- with :
111- name : MacOS-PM${{ matrix.pm-version-major }}
112- path : |
113- ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}*.tar.gz
114- install.log
115- compile.sh
116- if-no-files-found : error
117-
118- - name : Prepare workspace for upload
119- if : failure()
120- run : tar -czf workspace.tar.gz install_data
121-
122- - name : Upload workspace
123- uses : actions/upload-artifact@v3
124- if : failure()
125- with :
126- name : MacOS-workspace-PM${{ matrix.pm-version-major }}
127- path : |
128- workspace.tar.gz
129- if-no-files-found : error
130-
131- windows :
132- name : Windows (PM ${{ matrix.pm-version-major }})
133- runs-on : windows-2019
134- strategy :
135- matrix :
136- pm-version-major : [ 4, 5 ]
137-
138- steps :
139- - uses : actions/checkout@v4
140-
141- - name : Install tools and dependencies
142- run : choco install wget --no-progress
143-
144- - name : Compile PHP
145- run : .\windows-compile-vs.bat
146- env :
147- VS_EDITION : Enterprise
148- SOURCES_PATH : ${{ github.workspace }}\pocketmine-php-sdk
149- PM_VERSION_MAJOR : ${{ matrix.pm-version-major }}
150-
151- - name : Rename artifacts
152- run : |
153- mkdir temp
154- move php-debug-pack-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}-debugging-symbols.zip
155- move php-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}.zip
156- move temp\*.zip .
157-
158- - name : Upload artifacts
159- uses : actions/upload-artifact@v3
160- if : always()
161- with :
162- name : Windows-PM${{ matrix.pm-version-major }}
163- path : |
164- PHP-Windows-x64*.zip
165- compile.log
166- windows-compile-vs.bat
167- if-no-files-found : error
21+ uses : ./.github/workflows/main-pm-matrix.yml
22+ with :
23+ pm-version-major : ${{ matrix.pm-version-major }}
24+ secrets : inherit
16825
16926 publish :
17027 name : Publish binaries
171- needs : [linux, macos, windows ]
28+ needs : [all-builds ]
17229 runs-on : ubuntu-20.04
17330 if : ${{ startsWith(github.ref_name, 'php/') && github.ref_type == 'branch' && !contains(github.event.head_commit.message, '[no release]') }}
17431
18643 git push -f origin php-${{ steps.version.outputs.PHP_VERSION }}-latest
18744
18845 - name : Download artifacts
189- uses : actions/download-artifact@v3
46+ uses : actions/download-artifact@v4
19047 with :
19148 path : ${{ github.workspace }}
19249
@@ -213,11 +70,11 @@ jobs:
21370 echo ":information_source: **Linux/MacOS users**: Please see [this page](https://doc.pmmp.io/en/rtfd/faq/installation/opcache.so.html) to fix extension loading errors. Also, check out the [PocketMine-MP Linux/MacOS installer](https://doc.pmmp.io/en/rtfd/installation/get-dot-pmmp-dot-io.html)." >> changelog.md
21471
21572 - name : Update latest branch release
216- uses : ncipollo/release-action@v1.13 .0
73+ uses : ncipollo/release-action@v1.14 .0
21774 with :
21875 artifacts : |
21976 ${{ github.workspace }}/Linux-PM*/*.tar.gz
220- ${{ github.workspace }}/MacOS-PM*/*.tar.gz
77+ ${{ github.workspace }}/MacOS-*- PM*/*.tar.gz
22178 ${{ github.workspace }}/Windows-PM*/*.zip
22279 makeLatest : ${{ github.ref_name == github.event.repository.default_branch }}
22380 name : PHP ${{ steps.version.outputs.PHP_VERSION }} - Latest (Build ${{ github.run_number }})
@@ -229,11 +86,11 @@ jobs:
22986 prerelease : ${{ endsWith(github.ref_name, '-preview') }}
23087
23188 - name : Publish unique release
232- uses : ncipollo/release-action@v1.13 .0
89+ uses : ncipollo/release-action@v1.14 .0
23390 with :
23491 artifacts : |
23592 ${{ github.workspace }}/Linux-PM*/*.tar.gz
236- ${{ github.workspace }}/MacOS-PM*/*.tar.gz
93+ ${{ github.workspace }}/MacOS-*- PM*/*.tar.gz
23794 ${{ github.workspace }}/Windows-PM*/*.zip
23895 makeLatest : false
23996 name : PHP ${{ steps.version.outputs.PHP_VERSION }} (Build ${{ github.run_number }})
0 commit comments