7
7
description : ' PocketMine-MP major version'
8
8
required : true
9
9
type : number
10
+ php-version-base :
11
+ description : ' PHP base version'
12
+ required : true
13
+ type : string
14
+ special-release :
15
+ description : ' Special release type to create (pm-default-latest, pm-default, none)'
16
+ required : true
17
+ type : string
18
+ pm-preview :
19
+ description : " Mark releases as pre-release"
20
+ required : true
21
+ type : boolean
22
+
23
+ env :
24
+ MUSL_CROSS_MAKE_VERSION : 7b9487e56efc83c419a397af7df7f119001dc51c
10
25
11
26
jobs :
27
+ android :
28
+ name : Android arm64
29
+ runs-on : ubuntu-20.04
30
+
31
+ steps :
32
+ - uses : actions/checkout@v4
33
+
34
+ - name : Install tools and dependencies
35
+ run : |
36
+ sudo apt-get update
37
+ sudo apt-get install make autoconf automake libtool libtool-bin m4 wget libc-bin gzip bzip2 bison g++ git re2c
38
+
39
+ - name : Prepare compile.sh download cache
40
+ id : download-cache
41
+ uses : actions/cache@v4
42
+ with :
43
+ path : ./download_cache
44
+ key : compile-sh-cache-ssl-https-${{ hashFiles('./compile.sh') }}
45
+ restore-keys : compile-sh-cache-ssl-https-
46
+
47
+ - name : Fetch compiler cache
48
+ id : compiler-cache
49
+ uses : actions/cache@v4
50
+ with :
51
+ path : ${{ github.workspace }}/compiler
52
+ key : musl-cross-make-${{ env.MUSL_CROSS_MAKE_VERSION }}
53
+ restore-keys : musl-cross-make-
54
+
55
+ - name : Checkout musl-cross-make
56
+ uses : actions/checkout@v4
57
+ with :
58
+ repository : pmmp/musl-cross-make
59
+ path : musl-cross-make
60
+ ref : ${{ env.MUSL_CROSS_MAKE_VERSION }}
61
+
62
+ - name : Build compiler
63
+ working-directory : musl-cross-make
64
+ run : |
65
+ echo "TARGET = aarch64-linux-musl" > config.mak
66
+ make -j$(nproc)
67
+ make install
68
+ mv ./output "${{ github.workspace }}/compiler"
69
+
70
+ - name : Compile PHP
71
+ run : |
72
+ export PATH="${{ github.workspace }}/compiler/bin:$PATH"
73
+
74
+ # Used "set -ex" instead of hashbang since script isn't executed with hashbang
75
+ set -ex
76
+ trap "exit 1" ERR
77
+ ./compile.sh -t android-aarch64 -x -j 4 -g -F -P ${{ inputs.pm-version-major }} -c ./download_cache -D -z ${{ inputs.php-version-base }}
78
+
79
+
80
+ - name : Create tarball
81
+ run : |
82
+ tar -czf ./PHP-${{ inputs.php-version-base }}-Android-arm64-PM${{ inputs.pm-version-major }}.tar.gz bin
83
+ tar -czf ./PHP-${{ inputs.php-version-base }}-Android-arm64-PM${{ inputs.pm-version-major }}-debugging-symbols.tar.gz bin-debug
84
+
85
+ - name : Upload artifacts
86
+ uses : actions/upload-artifact@v4
87
+ if : always()
88
+ with :
89
+ name : PHP-${{ inputs.php-version-base }}-Android-PM${{ inputs.pm-version-major }}
90
+ path : |
91
+ ./PHP-${{ inputs.php-version-base }}-Android-arm64-PM${{ inputs.pm-version-major }}*.tar.gz
92
+ install.log
93
+ compile.sh
94
+ if-no-files-found : error
95
+
96
+ - name : Prepare workspace for upload
97
+ if : failure()
98
+ run : tar -czf workspace.tar.gz install_data
99
+
100
+ - name : Upload workspace
101
+ uses : actions/upload-artifact@v4
102
+ if : failure()
103
+ with :
104
+ name : PHP-${{ inputs.php-version-base }}-Android-workspace-PM${{ inputs.pm-version-major }}
105
+ path : |
106
+ workspace.tar.gz
107
+ if-no-files-found : error
108
+
12
109
linux :
13
110
name : Linux
14
111
runs-on : ubuntu-20.04
@@ -34,20 +131,20 @@ jobs:
34
131
# Used "set -ex" instead of hashbang since script isn't executed with hashbang
35
132
set -ex
36
133
trap "exit 1" ERR
37
- ./compile.sh -t linux64 -j 4 -g -F -P ${{ inputs.pm-version-major }} -c ./download_cache -D
134
+ ./compile.sh -t linux64 -j 4 -g -F -P ${{ inputs.pm-version-major }} -c ./download_cache -D -z ${{ inputs.php-version-base }}
38
135
39
136
- name : Create tarball
40
137
run : |
41
- tar -czf ./PHP-Linux-x86_64-PM${{ inputs.pm-version-major }}.tar.gz bin
42
- tar -czf ./PHP-Linux-x86_64-PM${{ inputs.pm-version-major }}-debugging-symbols.tar.gz bin-debug
138
+ tar -czf ./PHP-${{ inputs.php-version-base }}- Linux-x86_64-PM${{ inputs.pm-version-major }}.tar.gz bin
139
+ tar -czf ./PHP-${{ inputs.php-version-base }}- Linux-x86_64-PM${{ inputs.pm-version-major }}-debugging-symbols.tar.gz bin-debug
43
140
44
141
- name : Upload artifacts
45
142
uses : actions/upload-artifact@v4
46
143
if : always()
47
144
with :
48
- name : Linux-PM${{ inputs.pm-version-major }}
145
+ name : PHP-${{ inputs.php-version-base }}- Linux-PM${{ inputs.pm-version-major }}
49
146
path : |
50
- ./PHP-Linux-x86_64-PM${{ inputs.pm-version-major }}*.tar.gz
147
+ ./PHP-${{ inputs.php-version-base }}- Linux-x86_64-PM${{ inputs.pm-version-major }}*.tar.gz
51
148
install.log
52
149
compile.sh
53
150
if-no-files-found : error
60
157
uses : actions/upload-artifact@v4
61
158
if : failure()
62
159
with :
63
- name : Linux-workspace-PM${{ inputs.pm-version-major }}
160
+ name : PHP-${{ inputs.php-version-base }}- Linux-workspace-PM${{ inputs.pm-version-major }}
64
161
path : |
65
162
workspace.tar.gz
66
163
if-no-files-found : error
73
170
include :
74
171
- target-name : mac-x86-64
75
172
artifact-name : x86_64
76
- image : macos-12
173
+ image : macos-13
77
174
- target-name : mac-arm64
78
175
artifact-name : arm64
79
176
image : macos-14
@@ -82,8 +179,11 @@ jobs:
82
179
- uses : actions/checkout@v4
83
180
84
181
- name : Install tools and dependencies
85
- run : brew install libtool autoconf automake pkg-config bison re2c
86
-
182
+ run : |
183
+ #workaround github actions default image providing outdated pkg-config
184
+ brew uninstall --ignore-dependencies --force [email protected] || true
185
+ brew install libtool autoconf automake pkg-config bison re2c
186
+
87
187
- name : Prepare compile.sh download cache
88
188
id : download-cache
89
189
uses : actions/cache@v4
@@ -97,20 +197,20 @@ jobs:
97
197
export PATH="/usr/local/opt/bison/bin:$PATH"
98
198
set -ex
99
199
trap "exit 1" ERR
100
- ./compile.sh -t ${{ matrix.target-name }} -j4 -g -F -P ${{ inputs.pm-version-major }} -c ./download_cache -D
200
+ ./compile.sh -t ${{ matrix.target-name }} -j4 -g -F -P ${{ inputs.pm-version-major }} -c ./download_cache -D -z ${{ inputs.php-version-base }}
101
201
102
202
- name : Create tarball
103
203
run : |
104
- tar -czf ./PHP-MacOS-${{ matrix.artifact-name }}-PM${{ inputs.pm-version-major }}.tar.gz bin
105
- tar -czf ./PHP-MacOS-${{ matrix.artifact-name }}-PM${{ inputs.pm-version-major }}-debugging-symbols.tar.gz bin-debug
204
+ tar -czf ./PHP-${{ inputs.php-version-base }}- MacOS-${{ matrix.artifact-name }}-PM${{ inputs.pm-version-major }}.tar.gz bin
205
+ tar -czf ./PHP-${{ inputs.php-version-base }}- MacOS-${{ matrix.artifact-name }}-PM${{ inputs.pm-version-major }}-debugging-symbols.tar.gz bin-debug
106
206
107
207
- name : Upload artifacts
108
208
uses : actions/upload-artifact@v4
109
209
if : always()
110
210
with :
111
- name : MacOS-${{ matrix.artifact-name }}-PM${{ inputs.pm-version-major }}
211
+ name : PHP-${{ inputs.php-version-base }}- MacOS-${{ matrix.artifact-name }}-PM${{ inputs.pm-version-major }}
112
212
path : |
113
- ./PHP-MacOS-${{ matrix.artifact-name}}-PM${{ inputs.pm-version-major }}*.tar.gz
213
+ ./PHP-${{ inputs.php-version-base }}- MacOS-${{ matrix.artifact-name}}-PM${{ inputs.pm-version-major }}*.tar.gz
114
214
install.log
115
215
compile.sh
116
216
if-no-files-found : error
@@ -123,7 +223,7 @@ jobs:
123
223
uses : actions/upload-artifact@v4
124
224
if : failure()
125
225
with :
126
- name : MacOS-${{ matrix.artifact-name }}-workspace-PM${{ inputs.pm-version-major }}
226
+ name : PHP-${{ inputs.php-version-base }}- MacOS-${{ matrix.artifact-name }}-workspace-PM${{ inputs.pm-version-major }}
127
227
path : |
128
228
workspace.tar.gz
129
229
if-no-files-found : error
@@ -134,31 +234,117 @@ jobs:
134
234
135
235
steps :
136
236
- uses : actions/checkout@v4
137
-
138
- - name : Install tools and dependencies
139
- run : choco install wget --no-progress
140
-
237
+
238
+ - name : Prepare download cache
239
+ id : download-cache
240
+ uses : actions/cache@v4
241
+ with :
242
+ path : ./download_cache
243
+ key : windows-cache-${{ hashFiles('./windows-compile-vs.ps1') }}
244
+ restore-keys : windows-cache-
245
+
141
246
- name : Compile PHP
142
- run : .\windows-compile-vs.bat
247
+ run : .\windows-compile-vs.ps1
143
248
env :
144
- VS_EDITION : Enterprise
145
249
SOURCES_PATH : ${{ github.workspace }}\pocketmine-php-sdk
146
250
PM_VERSION_MAJOR : ${{ inputs.pm-version-major }}
251
+ PHP_VERSION_BASE : ${{ inputs.php-version-base }}
147
252
148
- - name : Rename artifacts
253
+ - name : Prepare artifacts
149
254
run : |
150
255
mkdir temp
151
- move php-debug-pack-*.zip temp/PHP -Windows-x64-PM${{ inputs.pm-version-major }}-debugging-symbols .zip
152
- move php-*.zip temp/PHP-Windows-x64-PM${{ inputs.pm-version-major }}.zip
256
+ Compress-Archive -Path .\bin -DestinationPath "PHP-${{ inputs.php-version-base }} -Windows-x64-PM${{ inputs.pm-version-major }}.zip"
257
+ move php-debug-pack- *.zip temp/PHP-${{ inputs.php-version-base }}- Windows-x64-PM${{ inputs.pm-version-major }}-debugging-symbols .zip
153
258
move temp\*.zip .
154
259
155
260
- name : Upload artifacts
156
261
uses : actions/upload-artifact@v4
157
262
if : always()
158
263
with :
159
- name : Windows-PM${{ inputs.pm-version-major }}
264
+ name : PHP-${{ inputs.php-version-base }}- Windows-PM${{ inputs.pm-version-major }}
160
265
path : |
161
- PHP-Windows-x64*.zip
266
+ PHP-${{ inputs.php-version-base }}- Windows-x64-PM${{ inputs.pm-version-major }} *.zip
162
267
compile.log
163
268
windows-compile-vs.bat
164
269
if-no-files-found : error
270
+
271
+
272
+ publish :
273
+ name : Publish binaries
274
+ needs : [linux, macos, windows, android]
275
+ runs-on : ubuntu-20.04
276
+ if : ${{ github.ref_name == 'stable' && github.ref_type == 'branch' && !contains(github.event.head_commit.message, '[no release]') }}
277
+ concurrency : release-${{ inputs.php-version-base }}-pm${{ inputs.pm-version-major }}
278
+
279
+ steps :
280
+ - uses : actions/checkout@v4
281
+
282
+ - name : Update latest tag target
283
+ run : |
284
+ git tag -f pm${{ inputs.pm-version-major }}-php-${{ inputs.php-version-base }}-latest
285
+ git push -f origin pm${{ inputs.pm-version-major }}-php-${{ inputs.php-version-base }}-latest
286
+ git tag -f pm${{ inputs.pm-version-major }}-latest
287
+ git push -f origin pm${{ inputs.pm-version-major }}-latest
288
+
289
+ - name : Download artifacts
290
+ uses : actions/download-artifact@v4
291
+ with :
292
+ path : ${{ github.workspace }}
293
+ pattern : " PHP-${{ inputs.php-version-base }}-*-PM${{ inputs.pm-version-major }}"
294
+
295
+ - name : Generate release notes
296
+ run : |
297
+ echo "### PHP ${{ inputs.php-version-base }} for PocketMine-MP ${{ inputs.pm-version-major }}.x" > changelog.md
298
+ echo "Last updated on **$(date -u +'%d %b %Y at %H:%M:%S %Z')**" >> changelog.md
299
+ echo -e "\n\n" >> changelog.md
300
+ echo "Built by: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> changelog.md
301
+ echo "Build number: ${{ github.run_number }}" >> changelog.md
302
+ echo -e "\n\n\n" >> changelog.md
303
+ 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
304
+ echo ":warning: **Windows users**: Don't forget to install [Visual C++ Redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe) or the binary will not work!" >> changelog.md
305
+ echo -e "\n\n\n" >> changelog.md
306
+
307
+ if [[ "${{ inputs.special-release }}" != "none" ]]; then
308
+ echo ":white_check_mark: At the time of publication, this version is recommended for PocketMine-MP ${{ inputs.pm-version-major }}.x production servers." >> changelog.md
309
+ else
310
+ echo ":warning: WARNING! :warning:" >> changelog.md
311
+ echo "At the time of publication, plugins for PocketMine-MP ${{ inputs.pm-version-major }}.x may not work this PHP version." >> changelog.md
312
+ echo "If you have problems, try the [recommended PM${{ inputs.pm-version-major }} release](${{ github.server_url }}/${{ github.repository }}/releases/pm${{ inputs.pm-version-major }}-latest) instead." >> changelog.md
313
+ fi
314
+
315
+ - name : Get date
316
+ id : date
317
+ run : |
318
+ echo DATE=$(date -u +'%d %b %Y') >> $GITHUB_OUTPUT
319
+
320
+ - name : Update recommended PM release
321
+
322
+ if : ${{ inputs.special-release != 'none' }}
323
+ with :
324
+ artifacts : |
325
+ ${{ github.workspace }}/PHP-*-PM*/*.tar.gz
326
+ ${{ github.workspace }}/PHP-*-Windows-PM*/*.zip
327
+ name : PM ${{ inputs.pm-version-major }}.x (${{ steps.date.outputs.DATE }}) - Recommended
328
+ tag : pm${{ inputs.pm-version-major }}-latest
329
+ commit : ${{ github.sha }}
330
+ allowUpdates : true
331
+ removeArtifacts : true
332
+ bodyFile : ${{ github.workspace }}/changelog.md
333
+ makeLatest : ${{ inputs.special-release == 'default-latest' }}
334
+ prerelease : ${{ inputs.pm-preview == 'true' }}
335
+
336
+ - name : Update php-version PM release
337
+
338
+ with :
339
+ artifacts : |
340
+ ${{ github.workspace }}/PHP-*-PM*/*.tar.gz
341
+ ${{ github.workspace }}/PHP-*-Windows-PM*/*.zip
342
+ name : PM ${{ inputs.pm-version-major }}.x (${{ steps.date.outputs.DATE }}) - PHP ${{ inputs.php-version-base }}
343
+ tag : pm${{ inputs.pm-version-major }}-php-${{ inputs.php-version-base }}-latest
344
+ commit : ${{ github.sha }}
345
+ allowUpdates : true
346
+ removeArtifacts : true
347
+ bodyFile : ${{ github.workspace }}/changelog.md
348
+ makeLatest : false
349
+ prerelease : ${{ inputs.pm-preview == 'true' }}
350
+
0 commit comments