File tree Expand file tree Collapse file tree 16 files changed +110
-202
lines changed
Expand file tree Collapse file tree 16 files changed +110
-202
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,14 @@ jobs:
7272 mkdir -p pool/lib
7373 mkdir -p pool/ext
7474 mkdir -p runtime/
75- if [ ! -f runtime/php ] ; then
75+ test -f runtime/php && rm -f runtime/php
76+ if [ ! -f runtime/php/php ] ; then
7677 bash setup-php-runtime.sh
7778 fi
7879
7980 WORK_DIR=${{ github.workspace }}
80- export PATH=${WORK_DIR}/runtime/:$PATH
81- alias php="php -d curl.cainfo=${WORK_DIR}/runtime/cacert.pem -d openssl.cafile=${WORK_DIR}/runtime/cacert.pem"
81+ export PATH=${WORK_DIR}/runtime/php/ :$PATH
82+ alias php="php -d curl.cainfo=${WORK_DIR}/runtime/php/ cacert.pem -d openssl.cafile=${WORK_DIR}/runtime/php /cacert.pem"
8283
8384 composer install --no-interaction --no-autoloader --no-scripts --profile
8485 composer dump-autoload --optimize --profile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9494 mkdir -p pool/ext
9595 mkdir -p bin/
9696 mkdir -p runtime/
97- if [ ! -f runtime/php ] ; then
97+ test -f runtime/php && rm -f runtime/php
98+ if [ ! -f runtime/php/php ] ; then
9899 bash setup-php-runtime.sh
99100 fi
100101 bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -109,20 +110,20 @@ jobs:
109110 run : |
110111 set -eux
111112 uname -m
112- export PATH=/work/runtime:$PATH # 容器已经内置 php 和 composer
113- alias php="php -d curl.cainfo=/work/runtime/cacert.pem -d openssl.cafile=/work/runtime/cacert.pem"
113+ export PATH=/work/runtime/php/ :$PATH # 容器已经内置 php 和 composer
114+ alias php="php -d curl.cainfo=/work/runtime/php/ cacert.pem -d openssl.cafile=/work/runtime/php /cacert.pem"
114115
115116 sh sapi/quickstart/linux/alpine-init.sh
116117 composer install --no-interaction --no-autoloader --no-scripts --profile
117118 composer dump-autoload --optimize --profile
118119
119120 php prepare.php
120121
121- bash ./ make.sh all-library
122+ bash make.sh all-library
122123
123- bash ./ make.sh config
124- bash ./ make.sh build
125- bash ./ make.sh archive
124+ bash make.sh config
125+ bash make.sh build
126+ bash make.sh archive
126127
127128 - name : Show Build Result
128129 run : |
Original file line number Diff line number Diff line change 9494 mkdir -p pool/ext
9595 mkdir -p bin/
9696 mkdir -p runtime/
97- if [ ! -f runtime/php ] ; then
97+ test -f runtime/php && rm -f runtime/php
98+ if [ ! -f runtime/php/php ] ; then
9899 bash setup-php-runtime.sh
99100 fi
100101 bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -109,20 +110,20 @@ jobs:
109110 run : |
110111 set -eux
111112 uname -m
112- export PATH=/work/runtime:$PATH # 容器已经内置 php 和 composer
113- alias php="php -d curl.cainfo=/work/runtime/cacert.pem -d openssl.cafile=/work/runtime/cacert.pem"
113+ export PATH=/work/runtime/php :$PATH # 容器已经内置 php 和 composer
114+ alias php="php -d curl.cainfo=/work/runtime/php/ cacert.pem -d openssl.cafile=/work/runtime/php /cacert.pem"
114115
115116 sh sapi/quickstart/linux/alpine-init.sh
116117 composer install --no-interaction --no-autoloader --no-scripts --profile
117118 composer dump-autoload --optimize --profile
118119
119120 php prepare.php
120121
121- bash ./ make.sh all-library
122+ bash make.sh all-library
122123
123- bash ./ make.sh config
124- bash ./ make.sh build
125- bash ./ make.sh archive
124+ bash make.sh config
125+ bash make.sh build
126+ bash make.sh archive
126127
127128 - name : Start Database
128129 run : |
Original file line number Diff line number Diff line change 8989 mkdir -p pool/ext
9090 mkdir -p bin/
9191 mkdir -p runtime/
92- if [ ! -f runtime/php ] ; then
92+ test -f runtime/php && rm -f runtime/php
93+ if [ ! -f runtime/php/php ] ; then
9394 bash setup-php-runtime.sh
9495 fi
9596 bash sapi/download-box/download-box-get-archive-from-server.sh
9899
99100 - name : prepare
100101 run : |
101- export PATH=${{ github.workspace }}/runtime:$PATH
102- alias php="php -d curl.cainfo=${{ github.workspace }}/runtime/cacert.pem -d openssl.cafile=${{ github.workspace }}/runtime/cacert.pem"
102+ export PATH=${{ github.workspace }}/runtime/php/ :$PATH
103+ alias php="php -d curl.cainfo=${{ github.workspace }}/runtime/php/ cacert.pem -d openssl.cafile=${{ github.workspace }}/runtime/php /cacert.pem"
103104
104105 composer install --no-interaction --no-autoloader --no-scripts --profile
105106 composer dump-autoload --optimize --profile
@@ -108,13 +109,13 @@ jobs:
108109
109110 - name : Build
110111 run : |
111- export PATH=${{ github.workspace }}/runtime:$PATH
112+ export PATH=${{ github.workspace }}/runtime/php/ :$PATH
112113
113- bash ./ make.sh all-library
114+ bash make.sh all-library
114115
115- bash ./ make.sh config
116- bash ./ make.sh build
117- bash ./ make.sh archive
116+ bash make.sh config
117+ bash make.sh build
118+ bash make.sh archive
118119
119120 - name : Show Build Result
120121 run : |
Original file line number Diff line number Diff line change 8989 mkdir -p pool/ext
9090 mkdir -p bin/
9191 mkdir -p runtime/
92- if [ ! -f runtime/php ] ; then
92+ test -f runtime/php && rm -f runtime/php
93+ if [ ! -f runtime/php/php ] ; then
9394 bash setup-php-runtime.sh
9495 fi
9596 bash sapi/download-box/download-box-get-archive-from-server.sh
9899
99100 - name : prepare
100101 run : |
101- export PATH=${{ github.workspace }}/runtime:$PATH
102- alias php="php -d curl.cainfo=${{ github.workspace }}/runtime/cacert.pem -d openssl.cafile=${{ github.workspace }}/runtime/cacert.pem"
102+ export PATH=${{ github.workspace }}/runtime/php/ :$PATH
103+ alias php="php -d curl.cainfo=${{ github.workspace }}/runtime/php/ cacert.pem -d openssl.cafile=${{ github.workspace }}/runtime/php /cacert.pem"
103104
104105 composer install --no-interaction --no-autoloader --no-scripts --profile
105106 composer dump-autoload --optimize --profile
@@ -108,7 +109,7 @@ jobs:
108109
109110 - name : Build
110111 run : |
111- export PATH=${{ github.workspace }}/runtime:$PATH
112+ export PATH=${{ github.workspace }}/runtime/php/ :$PATH
112113
113114 bash ./make.sh all-library
114115
Original file line number Diff line number Diff line change 4545
4646curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.sh? raw=true | bash
4747
48+ # windows powershell
49+ irm https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.ps1? raw=true | iex
50+
4851# 来自 https://www.swoole.com/download
4952curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.sh? raw=true | bash -s -- --mirror china
5053
@@ -88,9 +91,8 @@ bash setup-php-runtime.sh --mirror china
8891# shell脚本中启用别名扩展功能
8992shopt -s expand_aliases
9093__DIR__=$( pwd)
91- export PATH=" ${__DIR__} /runtime:$PATH "
92- ln -sf ${__DIR__} /runtime/swoole-cli ${__DIR__} /runtime/php
93- alias php=" php -d curl.cainfo=${__DIR__} /runtime/cacert.pem -d openssl.cafile=${__DIR__} /runtime/cacert.pem"
94+ export PATH=" ${__DIR__} /runtime/php/:$PATH "
95+ alias php=" php -d curl.cainfo=${__DIR__} /runtime/php/cacert.pem -d openssl.cafile=${__DIR__} /runtime/php/cacert.pem"
9496which php
9597php -v
9698
Original file line number Diff line number Diff line change @@ -137,16 +137,16 @@ if [ "$OS" = 'macos' ]; then
137137
138138fi
139139
140- if [ ! -f " ${__PROJECT__} /runtime/php" ]; then
140+ if [ ! -f " ${__PROJECT__} /runtime/php/php " ]; then
141141 if [ " $MIRROR " = ' china' ]; then
142142 bash ${__PROJECT__} /setup-php-runtime.sh --mirror china
143143 else
144144 bash ${__PROJECT__} /setup-php-runtime.sh
145145 fi
146146fi
147147
148- export PATH=" ${__PROJECT__} /runtime:$PATH "
149- alias php=" php -d curl.cainfo=${__PROJECT__} /runtime/cacert.pem -d openssl.cafile=${__PROJECT__} /runtime/cacert.pem"
148+ export PATH=" ${__PROJECT__} /runtime/php/ :$PATH "
149+ alias php=" php -d curl.cainfo=${__PROJECT__} /runtime/php/ cacert.pem -d openssl.cafile=${__PROJECT__} /runtime/php /cacert.pem"
150150
151151php -v
152152
170170
171171# 可用配置参数
172172# --with-swoole-pgsql=1
173+ # --with-libavif=1
173174# --with-global-prefix=/usr/local/swoole-cli
174175# --with-dependency-graph=1
175176# --with-web-ui
Original file line number Diff line number Diff line change @@ -49,12 +49,6 @@ while [ $# -gt 0 ]; do
4949 shift $(( $# > 0 ? 1 : 0 ))
5050done
5151
52- case " $MIRROR " in
53- china | openatom)
54- CONTAINER_BASE_IMAGE=" docker.io/library/alpine:3.18"
55- ;;
56- esac
57-
5852mkdir -p var/build-export-container/
5953cd ${__PROJECT__} /var/build-export-container/
6054
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -exu
4+ __DIR__=$(
5+ cd " $( dirname " $0 " ) "
6+ pwd
7+ )
8+ __PROJECT__=$(
9+ cd ${__DIR__} /../../../
10+ pwd
11+ )
12+ cd ${__DIR__}
13+
14+ {
15+ docker stop swoole-cli-alpine-dev
16+ sleep 5
17+ } || {
18+ echo $?
19+ }
20+ cd ${__DIR__}
21+
22+ IMAGE=alpine:3.18
23+
24+ cd ${__DIR__}
25+
26+ mkdir -p /dev/shm/swoole-cli/thirdparty/
27+ mkdir -p /dev/shm/swoole-cli/ext/
28+ mkdir -p /dev/shm/swoole-cli/var/
29+
30+ docker run --rm --name swoole-cli-alpine-dev -d \
31+ -v ${__PROJECT__} :/work \
32+ -v /dev/shm/swoole-cli/thirdparty/:/work/thirdparty/ \
33+ -v /dev/shm/swoole-cli/ext/:/work/ext/ \
34+ -v /dev/shm/swoole-cli/var/:/work/var/ \
35+ -w /work --init $IMAGE tail -f /dev/null
You can’t perform that action at this time.
0 commit comments