Skip to content

Commit f03c61b

Browse files
authored
Merge pull request #977 from jingjingxyk/experiment-feature
Experiment feature
2 parents ecdd69a + 7f63e35 commit f03c61b

32 files changed

+980
-169
lines changed

.github/workflows/linux-aarch64-qemu.yml

Lines changed: 0 additions & 114 deletions
This file was deleted.

.github/workflows/linux-aarch64.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
mkdir -p pool/ext
9595
mkdir -p bin/
9696
mkdir -p runtime/
97-
if [ ! -f runtime/php ] ; then
97+
if [ ! -f runtime/php/php ] ; then
9898
bash setup-php-runtime.sh
9999
fi
100100
bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -109,8 +109,8 @@ jobs:
109109
run: |
110110
set -eux
111111
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"
112+
export PATH=/work/runtime/php/:$PATH # 容器已经内置 php 和 composer
113+
alias php="php -d curl.cainfo=/work/runtime/php/cacert.pem -d openssl.cafile=/work/runtime/php/cacert.pem"
114114
115115
# sed -i 's/mirrors.tuna.tsinghua.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories
116116
# sed -i 's/mirrors.ustc.edu.cn/dl-cdn.alpinelinux.org/g' /etc/apk/repositories

.github/workflows/linux-x86_64.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
mkdir -p pool/ext
114114
mkdir -p bin/
115115
mkdir -p runtime/
116-
if [ ! -f runtime/php ] ; then
116+
if [ ! -f runtime/php/php ] ; then
117117
bash setup-php-runtime.sh
118118
fi
119119
@@ -134,8 +134,8 @@ jobs:
134134
run: |
135135
set -eux
136136
uname -m
137-
export PATH=/work/runtime:$PATH # 容器已经内置 php 和 composer
138-
alias php="php -d curl.cainfo=/work/runtime/cacert.pem -d openssl.cafile=/work/runtime/cacert.pem"
137+
export PATH=/work/runtime/php:$PATH # 容器已经内置 php 和 composer
138+
alias php="php -d curl.cainfo=/work/runtime/php/cacert.pem -d openssl.cafile=/work/runtime/php/cacert.pem"
139139
140140
# bash sapi/quickstart/mark-install-library-cached.sh
141141

.github/workflows/macos-aarch64.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
mkdir -p pool/ext
9191
mkdir -p bin/
9292
mkdir -p runtime/
93-
if [ ! -f runtime/php ] ; then
93+
if [ ! -f runtime/php/php ] ; then
9494
bash setup-php-runtime.sh
9595
fi
9696
bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -99,8 +99,8 @@ jobs:
9999
100100
- name: prepare
101101
run: |
102-
export PATH=${{ github.workspace }}/runtime:$PATH
103-
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"
104104
105105
composer install --no-interaction --no-autoloader --no-scripts --profile
106106
composer dump-autoload --optimize --profile
@@ -109,7 +109,7 @@ jobs:
109109
110110
- name: Build
111111
run: |
112-
export PATH=${{ github.workspace }}/runtime:$PATH
112+
export PATH=${{ github.workspace }}/runtime/php/:$PATH
113113
114114
bash make-install-deps.sh
115115

.github/workflows/macos-x86_64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
mkdir -p pool/ext
9191
mkdir -p bin/
9292
mkdir -p runtime/
93-
if [ ! -f runtime/php ] ; then
93+
if [ ! -f runtime/php/php ] ; then
9494
bash setup-php-runtime.sh
9595
fi
9696
bash sapi/download-box/download-box-get-archive-from-server.sh

.github/workflows/windows-cygwin.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
git config --global core.eol lf
2828
git config --global core.ignorecase false
2929
git config --global --add safe.directory ${{ github.workspace }}
30-
ipconfig
3130
3231
- uses: actions/checkout@v4
3332
- name: Prepare submodule
@@ -80,6 +79,11 @@ jobs:
8079
run: |
8180
bash ./sapi/scripts/cygwin/install-re2c.sh
8281
82+
- name: install deps lib with source code
83+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
84+
run: |
85+
bash ./sapi/scripts/msys2/install-libzip.sh
86+
8387
- name: Prepare
8488
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
8589
run: |
@@ -97,13 +101,19 @@ jobs:
97101
run: |
98102
bash ./sapi/scripts/cygwin/cygwin-build.sh
99103
104+
- name: Archive
105+
run: |
106+
bash ./sapi/scripts/cygwin/cygwin-archive.sh
107+
100108
- name: Show Build Result
101109
run: |
102110
./bin/swoole-cli -v
103111
./bin/swoole-cli -m
104112
./bin/swoole-cli --ri pdo_pgsql
105113
./bin/swoole-cli --ri swoole
106114
./bin/swoole-cli -r "echo PHP_VERSION;"
115+
ldd ./bin/swoole-cli
116+
./bin/swoole-cli -r "echo getcwd();echo PHP_EOL;"
107117
108118
- name: get app version with bash
109119
# 参考 https://github.com/marketplace/actions/install-cygwin
@@ -131,9 +141,6 @@ jobs:
131141
# Add-Content -Path $env:GITHUB_ENV -Value "name=$value"
132142
# Add-Content -Path $env:GITHUB_ENV -Value "APP_VERSION=$APP_VERSION"
133143
134-
- name: Archive
135-
run: |
136-
bash ./sapi/scripts/cygwin/cygwin-archive.sh
137144
138145
- name: production artifacts
139146
uses: actions/upload-artifact@v4
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: build-swoole-cli-windows-msys2
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
windows-msys2:
9+
if: 1
10+
runs-on: windows-2022
11+
steps:
12+
- name: Show Environment Info
13+
shell: cmd
14+
run: |
15+
ver
16+
wmic cpu get name, caption, maxclockspeed, status
17+
systeminfo
18+
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
19+
systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version"
20+
set
21+
ipconfig
22+
uname -a
23+
pwd
24+
ipconfig /all
25+
26+
- name: Prepare git
27+
run: |
28+
git config --global core.autocrlf false
29+
git config --global core.eol lf
30+
git config --global core.ignorecase false
31+
git config --global --add safe.directory ${{ github.workspace }}
32+
33+
- uses: actions/checkout@v4
34+
- name: Cache msys2 packages
35+
id: cache-msys2
36+
uses: actions/cache@v4
37+
env:
38+
cache-name: cache-msys2-packages
39+
with:
40+
path: C:\msys2-packages
41+
key: "${{ runner.os }}-build-${{ env.cache-name }}"
42+
43+
- name: Cache pool
44+
id: cache-msys2-pool
45+
uses: actions/cache@v4
46+
with:
47+
path: "${{ github.workspace }}\\pool\\"
48+
key: "${{ runner.os }}-build-pool-cache"
49+
50+
- uses: msys2/setup-msys2@v2
51+
# https://github.com/msys2/setup-msys2
52+
with:
53+
msystem: MSYS
54+
location: C:\msys2-packages
55+
56+
- name: prepare build environment
57+
shell: msys2 {0}
58+
run: |
59+
bash ./sapi/quickstart/windows/msys2-build/install-msys2.sh
60+
61+
- name: install deps lib with source code
62+
shell: msys2 {0}
63+
run: |
64+
bash ./sapi/scripts/msys2/install-deps-lib.sh
65+
66+
- name: Prepare
67+
shell: msys2 {0}
68+
run: |
69+
bash ./sapi/scripts/msys2/config-ext.sh
70+
71+
- name: Configure
72+
shell: msys2 {0}
73+
run: |
74+
bash ./sapi/scripts/msys2/config.sh
75+
76+
- name: Build
77+
shell: msys2 {0}
78+
run: |
79+
bash ./sapi/scripts/msys2/build.sh
80+
81+
- name: Archive
82+
shell: msys2 {0}
83+
run: |
84+
bash ./sapi/scripts/msys2/archive.sh
85+
86+
- name: Show Build Result
87+
shell: msys2 {0}
88+
run: |
89+
./bin/swoole-cli.exe -v
90+
./bin/swoole-cli.exe -m
91+
./bin/swoole-cli.exe --ri swoole
92+
./bin/swoole-cli.exe -r "echo PHP_VERSION;"
93+
ldd ./bin/swoole-cli.exe
94+
95+
- name: get app version with bash
96+
shell: msys2 {0}
97+
run: |
98+
APP_VERSION=$(cat ./APP_VERSION)
99+
APP_NAME=$(cat ./APP_NAME)
100+
echo $APP_VERSION
101+
echo $APP_NAME
102+
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
103+
echo "APP_NAME=${APP_NAME}" >> $GITHUB_ENV
104+
105+
- name: production artifacts
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64
109+
retention-days: 90
110+
path: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64.zip
111+
112+
- name: gh release
113+
uses: softprops/action-gh-release@v2
114+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
with:
118+
files: ${{ env.APP_NAME }}-${{ env.APP_VERSION }}-msys2-x64.zip

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545

4646
curl -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
4952
curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.sh?raw=true | bash -s -- --mirror china
5053

@@ -89,9 +92,8 @@ bash setup-php-runtime.sh --mirror china
8992
# shell脚本中启用别名扩展功能‌
9093
shopt -s expand_aliases
9194
__DIR__=$(pwd)
92-
export PATH="${__DIR__}/runtime:$PATH"
93-
ln -sf ${__DIR__}/runtime/swoole-cli ${__DIR__}/runtime/php
94-
alias php="php -d curl.cainfo=${__DIR__}/runtime/cacert.pem -d openssl.cafile=${__DIR__}/runtime/cacert.pem"
95+
export PATH="${__DIR__}/runtime/php/:$PATH"
96+
alias php="php -d curl.cainfo=${__DIR__}/runtime/php/cacert.pem -d openssl.cafile=${__DIR__}/runtime/php/cacert.pem"
9597
which php
9698
php -v
9799

0 commit comments

Comments
 (0)