Skip to content

Commit 3b3a18e

Browse files
authored
Merge pull request #901 from jingjingxyk/experiment_v4.8.x
Experiment v4.8.x pull code
2 parents 1e15856 + 843498e commit 3b3a18e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+590
-251
lines changed

.github/workflows/artifact-hash.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@ on:
66
version:
77
required: true
88
description: "发版 版本号 tag"
9-
default: '--vesion v5.1.6.0'
9+
default: 'v6.0.0.0'
1010
type: string
11+
enable_upload_cloud_object_storage:
12+
required: false
13+
type: boolean
14+
description: "上传到云对象存储 (默认不需要上传)"
1115

1216
jobs:
1317
generate-artifact-hash:
1418
runs-on: ubuntu-latest
1519
steps:
1620
- uses: actions/checkout@v4
1721
- name: Show Release File Hash
18-
run:
19-
bash sapi/scripts/generate-artifact-hash.sh ${{ inputs.version }}
22+
run: |
23+
bash sapi/scripts/generate-artifact-hash.sh --version ${{ inputs.version }}
2024
2125
- name: production artifacts
2226
uses: actions/upload-artifact@v4
@@ -25,3 +29,14 @@ jobs:
2529
retention-days: 90
2630
path: |
2731
${{ inputs.version }}-sha256sum
32+
33+
- name: upload artifacts to cloud object storage
34+
if: ${{ (github.repository == 'swoole/swoole-cli') && (inputs.enable_upload_cloud_object_storage == true) }}
35+
env:
36+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
37+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
38+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
39+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
40+
run: |
41+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-all --swoole-cli-version ${{ inputs.version }}
42+

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
key: source-code-tarball-pool
6262

6363
- name: Clean Source Code Tarball Cache On Release
64-
if: startsWith(github.ref, 'refs/tags/')
64+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
6565
run:
6666
rm -rf ${{ github.workspace }}/pool/*
6767

@@ -100,7 +100,6 @@ jobs:
100100
ls -A pool/ext/
101101
102102
- name: production artifacts
103-
if: 1
104103
uses: actions/upload-artifact@v4
105104
with:
106105
name: all-deps
@@ -111,7 +110,7 @@ jobs:
111110
112111
- name: gh release
113112
uses: softprops/action-gh-release@v2
114-
if: startsWith(github.ref, 'refs/tags/')
113+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
115114
with:
116115
files: |
117116
all-deps.zip

.github/workflows/linux-aarch64.yml

+10
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,13 @@ jobs:
194194
if: startsWith(github.ref, 'refs/tags/')
195195
with:
196196
files: swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz
197+
198+
- name: upload artifacts to cloud object storage
199+
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
200+
env:
201+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
202+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
203+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
204+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
205+
run: |
206+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz

.github/workflows/linux-x86_64.yml

+10
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,13 @@ jobs:
181181
if: startsWith(github.ref, 'refs/tags/')
182182
with:
183183
files: swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz
184+
185+
- name: upload artifacts to cloud object storage
186+
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
187+
env:
188+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
189+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
190+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
191+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
192+
run: |
193+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz

.github/workflows/macos-aarch64.yml

+10
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,13 @@ jobs:
152152
if: startsWith(github.ref, 'refs/tags/')
153153
with:
154154
files: swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz
155+
156+
- name: upload artifacts to cloud object storage
157+
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
158+
env:
159+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
160+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
161+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
162+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
163+
run: |
164+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz

.github/workflows/macos-x86_64.yml

+10
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,13 @@ jobs:
154154
if: startsWith(github.ref, 'refs/tags/')
155155
with:
156156
files: swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz
157+
158+
- name: upload artifacts to cloud object storage
159+
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
160+
env:
161+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
162+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
163+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
164+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
165+
run: |
166+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz

.github/workflows/runner-images.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[runner-images](https://github.com/actions/runner-images/tree/main/images)
2+
3+
[available-images](https://github.com/actions/runner-images?tab=readme-ov-file#available-images)
4+
5+
[choosing-github-hosted-runners](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners)

.github/workflows/windows-cygwin.yml

+53-10
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,28 @@ on: [ push, pull_request ]
55
jobs:
66
windows-cygwin:
77
if: 1
8-
runs-on: windows-latest
8+
runs-on: windows-2022
99
steps:
10-
- name: Prepare git
10+
- name: Show Environment Info
11+
shell: cmd
1112
run: |
12-
git config --global core.autocrlf false
13-
git config --global core.eol lf
14-
env
13+
ver
14+
wmic cpu get name, caption, maxclockspeed, status
15+
systeminfo
16+
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
17+
systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version"
18+
set
1519
ipconfig
1620
uname -a
1721
pwd
1822
ipconfig /all
1923
24+
- name: Prepare git
25+
run: |
26+
git config --global core.autocrlf false
27+
git config --global core.eol lf
28+
git config --global core.ignorecase false
29+
2030
- uses: actions/checkout@v4
2131
- name: Prepare submodule
2232
run: |
@@ -41,35 +51,46 @@ jobs:
4151

4252
- name: Install Cygwin
4353
uses: cygwin/cygwin-install-action@v2
54+
with:
55+
site: https://mirrors.kernel.org/sourceware/cygwin/
4456
# with:
4557
# platform: x64
4658
# packages: make wget tar libtool re2c bison gcc-g++ autoconf automake openssl libpcre2-devel libssl-devel libcurl-devel libxml2-devel libxslt-devel libgmp-devel ImageMagick libpng-devel libjpeg-devel libfreetype-devel libwebp-devel libsqlite3-devel zlib-devel libbz2-devel liblz4-devel liblzma-devel libzip-devel libicu-devel libonig-devel libcares-devel libsodium-devel libyaml-devel libMagick-devel libzstd-devel libbrotli-devel libreadline-devel libintl-devel libpq-devel libssh2-devel libidn2-devel gettext-devel coreutils openssl-devel zip unzip
4759

48-
- name: Install Cygwin Packages
60+
- name: Install Cygwin Packages with bash
61+
if: 0
4962
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
5063
run: |
5164
ls -lah /cygdrive/c/
5265
ls -lah /cygdrive/d/
53-
5466
cp -f /cygdrive/c/setup.exe /cygdrive/c/cygwin/bin/setup-x86_64.exe
55-
5667
bash ./sapi/scripts/cygwin/install-cygwin.sh
5768
69+
- name: Install Cygwin Packages
70+
if: 1
71+
run: |
72+
Copy-Item -Path "C:\setup.exe" -Destination "${{ github.workspace }}\setup-x86_64.exe"
73+
cmd /c .\sapi\quickstart\windows\cygwin-build\install-cygwin.bat
74+
5875
- name: Install re2c
76+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
5977
run: |
6078
bash ./sapi/scripts/cygwin/install-re2c.sh
6179
62-
- name: Prepare
80+
- name: Configure
81+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
6382
run: |
6483
# git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli
6584
# git submodule update --init
6685
bash ./sapi/scripts/cygwin/cygwin-config-ext.sh
6786
6887
- name: Configure
88+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
6989
run: |
7090
bash ./sapi/scripts/cygwin/cygwin-config.sh
7191
7292
- name: Build
93+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
7394
run: |
7495
bash ./sapi/scripts/cygwin/cygwin-build.sh
7596
@@ -120,8 +141,30 @@ jobs:
120141

121142
- name: gh release
122143
uses: softprops/action-gh-release@v2
123-
if: startsWith(github.ref, 'refs/tags/')
144+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
124145
env:
125146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126147
with:
127148
files: swoole-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip
149+
150+
upload-to-cloud-object-storage:
151+
if: 0
152+
runs-on: ubuntu-latest
153+
needs: windows-cygwin
154+
steps:
155+
- name: Prepare Run Environment
156+
run:
157+
sudo apt install -y curl
158+
- uses: actions/checkout@v4
159+
- uses: actions/download-artifact@v4
160+
- name: upload artifacts to cloud object storage
161+
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
162+
env:
163+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
164+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
165+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
166+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
167+
run: |
168+
FILE_NAME=$(ls -d swoole-cli-v*-cygwin-x64)
169+
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
170+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${FILE}

docs/Cygwin.md

+31-7
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,43 @@
1212
1313
> 命令行同时安装多个包,包名之间使用逗号隔开
1414
15+
## windows 环境下 配置 git 环境
16+
17+
1. 禁止Git在提交和检出时进行换行符的自动转换‌
18+
2. 使用`lf` 作为换行符
19+
3. 区分大小写
20+
21+
```shell
22+
23+
# 下载git
24+
curl.exe -fSLo Git-2.47.1-64-bit.exe https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe
25+
26+
# 命令行静默安装 git
27+
start /wait .\Git-2.47.1-64-bit.exe /VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEONEXIT=1 /DIR="C:\Program Files\Git"
28+
29+
30+
git config --global core.autocrlf false
31+
git config --global core.eol lf
32+
git config --global core.ignorecase false
33+
34+
```
35+
1536
## 安装cygwin 和 cygwin 依赖项
1637

17-
> 打开 windows 控制台,并找到 setup-x86_64.exe 所在目录, 将 setup-x86_64.exe 复制到 `sapi\quickstart\windows\` 目录
18-
> 执行如下命令
38+
> 打开windows CMD 终端,进入项目目录 ,执行如下命令
1939
2040
```bash
2141

2242
# 自动安装 cygwin 和 cygwin 依赖项
23-
sapi\quickstart\windows\install-cygwin.bat
43+
.\sapi\quickstart\windows\cygwin-build\download-cygwin.bat
44+
.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat
45+
2446

2547
```
2648

2749
构建步骤 - 执行的命令
2850
====
29-
> 运行如下步骤,需要先 打开 cygwin64 Terminal
51+
> 运行如下步骤,打开 cygwin64 Terminal, 并进入项目目录,执行如下命令
3052
3153
```shell
3254

@@ -122,14 +144,16 @@ libzstd-devel
122144

123145
## 安装 cygwin 和 安装 cygwin 依赖项 具体执行的命令
124146

125-
> `sapi\quickstart\windows\install-cygwin.bat` 脚本包含的内容
147+
> 多个包之间 使用逗号分隔
148+
149+
> 编辑修改此文件即可 `.\sapi\quickstart\windows\cygwin-build\install-cygwin.bat`
126150
127151
```bash
128152
# 安装 cygwin
129-
setup-x86_64.exe --site https://mirrors.ustc.edu.cn/cygwin/
153+
setup-x86_64.exe --site https://mirrors.ustc.edu.cn/cygwin/
130154

131155
# 安装 cygwin 依赖项
132-
setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils,openssl-devel
156+
setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages make,git,curl,wget,tar,libtool,bison,gcc-g++,autoconf,automake,openssl,libpcre2-devel,libssl-devel,libcurl-devel,libxml2-devel,libxslt-devel,libgmp-devel,ImageMagick,libpng-devel,libjpeg-devel,libfreetype-devel,libwebp-devel,libsqlite3-devel,zlib-devel,libbz2-devel,liblz4-devel,liblzma-devel,libzip-devel,libicu-devel,libonig-devel,libcares-devel,libsodium-devel,libyaml-devel,libMagick-devel,libzstd-devel,libbrotli-devel,libreadline-devel,libintl-devel,libpq-devel,libssh2-devel,libidn2-devel,gettext-devel,coreutils
133157

134158
setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages zip unzip icu libicu-devel
135159

docs/options.md

-1
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,3 @@ GD库支持 AVIF图片格式
203203
with-iouring
204204
----
205205
swoole 启用支持 iouring 特性
206-

sapi/download-box/download-box-get-archive-from-server.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ mkdir -p ${__PROJECT__}/var/download-box/
1818

1919
cd ${__PROJECT__}/var/download-box/
2020

21-
ALL_DEPS_HASH="bdd159b93fd8217e89d206aeb22bf7a8295553db0aff332f049b9025feb31766"
21+
ALL_DEPS_HASH="a55699ecee994032f33266dfa37eabb49f1f6d6b6b65cdcf7b881cac09c63bea"
2222

23-
DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v5.1.5.1/'
23+
DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v6.0.0.0/'
2424

2525
while [ $# -gt 0 ]; do
2626
case "$1" in
@@ -38,7 +38,7 @@ done
3838

3939
URL="${DOMAIN}/all-deps.zip"
4040

41-
test -f all-deps.zip || curl -Lo all-deps.zip ${URL}
41+
test -f all-deps.zip || curl -fSLo all-deps.zip ${URL}
4242

4343
# hash 签名
4444
HASH=$(sha256sum all-deps.zip | awk '{print $1}')

sapi/quickstart/linux/arm64/README.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
# x86_64 运行 arm64
2-
> 使用 qemu-user-static 实现
1+
# `x86_64` 平台模拟 `arm64`
32

4-
## 参考文档
5-
qemu
6-
https://www.qemu.org/
7-
https://github.com/qemu/qemu.git
8-
9-
qemu-user-static
10-
https://github.com/multiarch/qemu-user-static.git
3+
使用 `qemu-user-static` 实现
114

12-
x86 平台利用 qemu-user-static 实现 arm64 平台 docker 镜像的运行和构建
13-
https://www.cnblogs.com/chen2ha/p/17180287.html
5+
## 参考文档
146

15-
Docker在x86架构的物理机上跑Qemu-arm 容器
16-
https://blog.csdn.net/sunSHINEEzy/article/details/80015638
7+
- [qemu 官网](https://www.qemu.org/)
8+
- [qemu GitHub](https://github.com/qemu/qemu.git)
9+
- [qemu-user-static](https://github.com/multiarch/qemu-user-static.git)
10+
- [x86 平台利用 qemu-user-static 实现 arm64 平台 docker 镜像的运行和构建](https://www.cnblogs.com/chen2ha/p/17180287.html)
11+
- [Docker在x86架构的物理机上跑Qemu-arm 容器](https://blog.csdn.net/sunSHINEEzy/article/details/80015638)
1712

1813

sapi/quickstart/linux/connection-swoole-cli-alpine.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ __DIR__=$(
88

99
cd ${__DIR__}
1010

11-
docker exec -it swoole-cli-alpine-dev sh
11+
docker exec -it woole-cli-builder sh

0 commit comments

Comments
 (0)