Skip to content

Commit e78ff2b

Browse files
authored
Merge pull request #952 from jingjingxyk/build_native_php
Build native php
2 parents a33baf8 + 39bb196 commit e78ff2b

36 files changed

+245
-198
lines changed

.github/workflows/artifact-hash.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
version:
77
required: true
88
description: "发版 版本号 tag"
9-
default: 'v1.7.1'
9+
default: 'v1.9.1'
1010
type: string
1111
php-version:
1212
required: true
1313
description: "PHP 版本号 "
14-
default: 'v8.1.31,v8.2.27,v8.3.15,v8.4.2'
14+
default: 'v8.1.32,v8.2.28,v8.3.19,v8.4.5'
1515
type: string
1616
enable_upload_cloud_object_storage:
1717
required: false

.github/workflows/auto-cache-pool-tarball.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,15 @@ jobs:
7171
set -x
7272
mkdir -p pool/lib
7373
mkdir -p pool/ext
74-
mkdir -p pool/php-tar
75-
mkdir -p bin/runtime
76-
mkdir -p bin/var
77-
if [ ! -f bin/runtime/php ] ; then
74+
mkdir -p pool/php-tar/
75+
mkdir -p runtime/
76+
if [ ! -f runtime/php ] ; then
7877
bash setup-php-runtime.sh
7978
fi
8079
81-
ls -A pool/lib/
8280
WORK_DIR=${{ github.workspace }}
83-
uname -m
84-
export PATH=${WORK_DIR}/bin/runtime:$PATH
85-
alias php="php -d curl.cainfo=${WORK_DIR}/bin/runtime/cacert.pem -d openssl.cafile=${WORK_DIR}/bin/runtime/cacert.pem"
81+
export PATH=${WORK_DIR}/runtime/:$PATH
82+
alias php="php -d curl.cainfo=${WORK_DIR}/runtime/cacert.pem -d openssl.cafile=${WORK_DIR}/runtime/cacert.pem"
8683
8784
composer install --no-interaction --no-autoloader --no-scripts --profile --no-dev
8885
composer dump-autoload --optimize --profile --no-dev

.github/workflows/linux-aarch64.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: actions/cache@v4
6060
id: php-runtime-cache-aarch64
6161
with:
62-
path: ${{ github.workspace }}/bin/runtime
62+
path: ${{ github.workspace }}/runtime
6363
key: ${{ runner.os }}-aarch64-php-runtime
6464

6565
- name: Cache PHP Vendor
@@ -103,8 +103,9 @@ jobs:
103103
set -x
104104
mkdir -p pool/lib
105105
mkdir -p pool/ext
106-
mkdir -p bin/runtime
107-
if [ ! -f bin/runtime/php ] ; then
106+
mkdir -p bin/
107+
mkdir -p runtime/
108+
if [ ! -f runtime/php ] ; then
108109
bash setup-php-runtime.sh
109110
fi
110111
bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -119,8 +120,8 @@ jobs:
119120
run: |
120121
set -eux
121122
uname -m
122-
export PATH=/work/bin/runtime:$PATH # 容器已经内置 php 和 composer
123-
alias php="php -d curl.cainfo=/work/bin/runtime/cacert.pem -d openssl.cafile=/work/bin/runtime/cacert.pem"
123+
export PATH=/work/runtime:$PATH # 容器已经内置 php 和 composer
124+
alias php="php -d curl.cainfo=/work/runtime/cacert.pem -d openssl.cafile=/work/runtime/cacert.pem"
124125
125126
# sed -i 's/mirrors.tuna.tsinghua.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories
126127
# sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories

.github/workflows/linux-x86_64.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
uses: actions/cache@v4
107107
id: php-runtime-cache-x86_64
108108
with:
109-
path: ${{ github.workspace }}/bin/runtime
109+
path: ${{ github.workspace }}/runtime
110110
key: ${{ runner.os }}-x86_64-php-runtime
111111

112112
- name: Cache PHP Vendor
@@ -150,8 +150,9 @@ jobs:
150150
set -x
151151
mkdir -p pool/lib
152152
mkdir -p pool/ext
153-
mkdir -p bin/runtime
154-
if [ ! -f bin/runtime/php ] ; then
153+
mkdir -p bin/
154+
mkdir -p runtime/
155+
if [ ! -f runtime/php ] ; then
155156
bash setup-php-runtime.sh
156157
fi
157158
@@ -172,8 +173,8 @@ jobs:
172173
run: |
173174
set -eux
174175
uname -m
175-
export PATH=/work/bin/runtime:$PATH # 容器已经内置 php 和 composer
176-
alias php="php -d curl.cainfo=/work/bin/runtime/cacert.pem -d openssl.cafile=/work/bin/runtime/cacert.pem"
176+
export PATH=/work/runtime:$PATH # 容器已经内置 php 和 composer
177+
alias php="php -d curl.cainfo=/work/runtime/cacert.pem -d openssl.cafile=/work/runtime/cacert.pem"
177178
178179
# bash sapi/quickstart/mark-install-library-cached.sh
179180

.github/workflows/macos-aarch64.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
uses: actions/cache@v4
7373
id: php-runtime-cache
7474
with:
75-
path: ${{ github.workspace }}/bin/runtime
75+
path: ${{ github.workspace }}/runtime
7676
key: ${{ runner.os }}-aarch64-php-runtime
7777

7878
- name: Cache PHP Vendor
@@ -101,18 +101,19 @@ jobs:
101101
set -x
102102
mkdir -p pool/lib
103103
mkdir -p pool/ext
104-
mkdir -p bin/runtime
105-
if [ ! -f bin/runtime/php ] ; then
106-
bash sapi/quickstart/setup-php-runtime.sh
104+
mkdir -p bin/
105+
mkdir -p runtime/
106+
if [ ! -f runtime/php ] ; then
107+
bash setup-php-runtime.sh
107108
fi
108109
bash sapi/download-box/download-box-get-archive-from-server.sh
109110
ls -A pool/lib/
110111
ls -A /usr/local/swoole-cli/
111112
112113
- name: prepare
113114
run: |
114-
export PATH=${{ github.workspace }}/bin/runtime:$PATH
115-
alias php="php -d curl.cainfo=${{ github.workspace }}/bin/runtime/cacert.pem -d openssl.cafile=${{ github.workspace }}/bin/runtime/cacert.pem"
115+
export PATH=${{ github.workspace }}/runtime:$PATH
116+
alias php="php -d curl.cainfo=${{ github.workspace }}/runtime/cacert.pem -d openssl.cafile=${{ github.workspace }}/runtime/cacert.pem"
116117
117118
composer install --no-interaction --no-autoloader --no-scripts --profile
118119
composer dump-autoload --optimize --profile
@@ -121,7 +122,7 @@ jobs:
121122
122123
- name: Build
123124
run: |
124-
export PATH=${{ github.workspace }}/bin/runtime:$PATH
125+
export PATH=${{ github.workspace }}/runtime:$PATH
125126
126127
bash make-install-deps.sh
127128

.github/workflows/macos-x86_64.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
uses: actions/cache@v4
8484
id: php-runtime-cache
8585
with:
86-
path: ${{ github.workspace }}/bin/runtime
86+
path: ${{ github.workspace }}/runtime
8787
key: ${{ runner.os }}-x86_64-php-runtime
8888

8989
- name: Cache PHP Vendor
@@ -112,18 +112,19 @@ jobs:
112112
set -x
113113
mkdir -p pool/lib
114114
mkdir -p pool/ext
115-
mkdir -p bin/runtime
116-
if [ ! -f bin/runtime/php ] ; then
117-
bash sapi/quickstart/setup-php-runtime.sh
115+
mkdir -p bin/
116+
mkdir -p runtime/
117+
if [ ! -f runtime/php ] ; then
118+
bash setup-php-runtime.sh
118119
fi
119120
bash sapi/download-box/download-box-get-archive-from-server.sh
120121
ls -A pool/lib/
121122
ls -A /usr/local/swoole-cli/
122123
123124
- name: prepare
124125
run: |
125-
export PATH=${{ github.workspace }}/bin/runtime:$PATH
126-
alias php="php -d curl.cainfo=${{ github.workspace }}/bin/runtime/cacert.pem -d openssl.cafile=${{ github.workspace }}/bin/runtime/cacert.pem"
126+
export PATH=${{ github.workspace }}/runtime:$PATH
127+
alias php="php -d curl.cainfo=${{ github.workspace }}/runtime/cacert.pem -d openssl.cafile=${{ github.workspace }}/runtime/cacert.pem"
127128
128129
composer install --no-interaction --no-autoloader --no-scripts --profile --no-dev
129130
composer dump-autoload --optimize --profile --no-dev
@@ -132,7 +133,7 @@ jobs:
132133
133134
- name: Build
134135
run: |
135-
export PATH=${{ github.workspace }}/bin/runtime:$PATH
136+
export PATH=${{ github.workspace }}/runtime:$PATH
136137
137138
bash make-install-deps.sh
138139

.github/workflows/windows-cygwin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99

1010
jobs:
1111
windows-cygwin:
12-
if: 1
12+
if: 0
1313
runs-on: windows-2022
1414
strategy:
1515
matrix:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,6 @@ swoole-cli-*
344344
php-cli-*
345345
php-fpm-*
346346
!sapi/patches
347+
/runtime
348+
!/runtime/.gitkeep
347349

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ bash setup-php-runtime.sh --mirror china
7373
# shell脚本中启用别名扩展功能‌
7474
shopt -s expand_aliases
7575
__DIR__=$(pwd)
76-
export PATH="${__DIR__}/bin/runtime:$PATH"
77-
ln -sf ${__DIR__}/bin/runtime/swoole-cli ${__DIR__}/bin/runtime/php
78-
alias php="php -d curl.cainfo=${__DIR__}/bin/runtime/cacert.pem -d openssl.cafile=${__DIR__}/bin/runtime/cacert.pem"
76+
export PATH="${__DIR__}/runtime:$PATH"
77+
ln -sf ${__DIR__}/runtime/swoole-cli ${__DIR__}/runtime/php
78+
alias php="php -d curl.cainfo=${__DIR__}/runtime/cacert.pem -d openssl.cafile=${__DIR__}/runtime/cacert.pem"
7979
which php
8080
php -v
8181

build-release-example.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ __DIR__=$(
55
pwd
66
)
77
__PROJECT__=${__DIR__}
8-
8+
shopt -s expand_aliases
99
if [ ! -f ${__DIR__}/prepare.php ]; then
1010
echo 'no found prepare.php'
1111
exit 0
@@ -177,20 +177,19 @@ if git ls-files --error-unmatch sapi/quickstart/clean-folder.sh >/dev/null 2>&1;
177177
test -f sapi/quickstart/clean-folder.sh && bash sapi/quickstart/clean-folder.sh
178178
fi
179179

180-
if [ ! -f "${__PROJECT__}/bin/runtime/php" ]; then
180+
if [ ! -f "${__PROJECT__}/runtime/php" ]; then
181181
if [ "$MIRROR" = 'china' ]; then
182-
bash sapi/quickstart/setup-php-runtime.sh --mirror china
182+
bash ${__PROJECT__}/setup-php-runtime.sh --mirror china
183183
else
184-
bash sapi/quickstart/setup-php-runtime.sh
184+
bash ${__PROJECT__}/setup-php-runtime.sh
185185
fi
186186
fi
187187

188-
export PATH="${__PROJECT__}/bin/runtime:$PATH"
188+
export PATH="${__PROJECT__}/runtime:$PATH"
189189
# 交互模式下alias 扩展默认是开启的,脚本模式下默认是关闭的
190190
# 在shell脚本中启用别名扩展功能‌
191191
shopt -s expand_aliases
192-
alias php="php -d curl.cainfo=${__PROJECT__}/bin/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/bin/runtime/cacert.pem"
193-
192+
alias php="php -d curl.cainfo=${__PROJECT__}/runtime/cacert.pem -d openssl.cafile=${__PROJECT__}/runtime/cacert.pem"
194193
php -v
195194

196195
if [ ${WITH_PHP_COMPOSER} -eq 1 ]; then

0 commit comments

Comments
 (0)