Skip to content

Commit 797bda1

Browse files
committed
merge code
2 parents d1ec949 + 0bbb0fc commit 797bda1

Some content is hidden

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

50 files changed

+591
-423
lines changed

.github/workflows/artifact-hash.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ on:
66
version:
77
required: true
88
description: "发版 版本号 tag"
9-
default: 'v1.6.0'
9+
default: 'v1.7.1'
1010
type: string
1111
php-version:
1212
required: true
1313
description: "PHP 版本号 "
14-
default: 'v8.1.30,v8.2.25,v8.3.13,v8.4.1'
14+
default: 'v8.1.31,v8.2.27,v8.3.15,v8.4.2'
1515
type: string
16+
enable_upload_cloud_object_storage:
17+
required: false
18+
type: boolean
19+
description: "上传到云对象存储 (默认不需要上传)"
1620

1721
jobs:
1822
generate-artifact-hash:
@@ -30,3 +34,14 @@ jobs:
3034
retention-days: 90
3135
path: |
3236
${{ inputs.version }}-sha256sum
37+
38+
- name: upload artifacts to cloud object storage
39+
if: ${{ 0 && (github.repository == 'swoole/swoole-cli') && (inputs.enable_upload_cloud_object_storage == true) }}
40+
env:
41+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
42+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
43+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
44+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
45+
run: |
46+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-all --swoole-cli-version ${{ inputs.version }}
47+

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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: build-php-cli-linux-aarch64
33
on: [ push, pull_request ]
44

55
env:
6-
BUILD_PHP_VERSION: 8.2.25
6+
BUILD_PHP_VERSION: 8.2.27
77

88
jobs:
99
linux-aarch64:
@@ -12,10 +12,10 @@ jobs:
1212
strategy:
1313
matrix:
1414
php-version:
15-
- "8.2.25"
16-
- "8.1.30"
17-
- "8.3.13"
18-
- "8.4.1"
15+
- "8.2.27"
16+
- "8.1.31"
17+
- "8.3.15"
18+
- "8.4.2"
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Show Environment Info

.github/workflows/linux-x86_64.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ on:
1818
php_version:
1919
required: true
2020
description: "定制构建选项: 指定 PHP 版本(版本号大于等于8.1)"
21-
default: '--with-php-version=8.2.13'
21+
default: '--with-php-version=8.2.27'
2222
type: choice
2323
options:
24-
- '--with-php-version=8.1.27'
25-
- '--with-php-version=8.2.13'
26-
- '--with-php-version=8.3.1'
24+
- '--with-php-version=8.1.31'
25+
- '--with-php-version=8.2.27'
26+
- '--with-php-version=8.3.15'
2727
build_type:
2828
required: true
2929
description: "定制构建选项: 指定构建类型"
@@ -39,7 +39,7 @@ on:
3939
type: string
4040

4141
env:
42-
BUILD_PHP_VERSION: 8.2.25
42+
BUILD_PHP_VERSION: 8.2.27
4343

4444
jobs:
4545
linux-x86_64:
@@ -48,10 +48,10 @@ jobs:
4848
strategy:
4949
matrix:
5050
php-version:
51-
- "8.2.25"
52-
- "8.1.30"
53-
- "8.3.13"
54-
- "8.4.1"
51+
- "8.2.27"
52+
- "8.1.31"
53+
- "8.3.15"
54+
- "8.4.2"
5555
steps:
5656
- uses: actions/checkout@v4
5757
- name: Show Environment Info

.github/workflows/macos-aarch64.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: build-php-cli-macos-aarch64
33
on: [ push, pull_request ]
44

55
env:
6-
BUILD_PHP_VERSION: 8.2.25
6+
BUILD_PHP_VERSION: 8.2.27
77

88
jobs:
99
macos-aarch64:
@@ -17,10 +17,10 @@ jobs:
1717
strategy:
1818
matrix:
1919
php-version:
20-
- "8.2.25"
21-
- "8.1.30"
22-
- "8.3.13"
23-
- "8.4.1"
20+
- "8.2.27"
21+
- "8.1.31"
22+
- "8.3.15"
23+
- "8.4.2"
2424

2525
steps:
2626
- uses: actions/checkout@v4

.github/workflows/macos-x86_64.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66

77
env:
8-
BUILD_PHP_VERSION: 8.2.25
8+
BUILD_PHP_VERSION: 8.2.27
99

1010
jobs:
1111
macos-x86_64:
@@ -19,11 +19,10 @@ jobs:
1919
strategy:
2020
matrix:
2121
php-version:
22-
- "8.2.25"
23-
- "8.1.30"
24-
- "8.3.13"
25-
- "8.4.1"
26-
22+
- "8.2.27"
23+
- "8.1.31"
24+
- "8.3.15"
25+
- "8.4.2"
2726
steps:
2827
- uses: actions/checkout@v4
2928
- name: Show Environment Info
@@ -174,3 +173,4 @@ jobs:
174173
files: |
175174
php-fpm-v${{ env.BUILD_PHP_VERSION }}-macos-x64.tar.xz
176175
php-fpm-v${{ env.BUILD_PHP_VERSION }}-macos-x64-debug.tar.xz
176+

.github/workflows/runner-images.md

Lines changed: 5 additions & 0 deletions
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/runner-os-readme.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/windows-cygwin.yml

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,40 @@ on:
55
pull_request:
66

77
env:
8-
BUILD_PHP_VERSION: 8.2.25
8+
BUILD_PHP_VERSION: 8.2.27
99

1010
jobs:
1111
windows-cygwin:
12-
if: 0
13-
runs-on: windows-latest
12+
if: 1
13+
runs-on: windows-2022
1414
strategy:
1515
matrix:
1616
php-version:
17-
- "8.2.25"
18-
- "8.1.30"
19-
- "8.3.13"
20-
- "8.4.1"
21-
17+
- "8.2.27"
18+
- "8.1.31"
19+
- "8.3.15"
20+
- "8.4.2"
2221
steps:
23-
- name: Prepare git
22+
- name: Show Environment Info
23+
shell: cmd
2424
run: |
25-
git config --global core.autocrlf false
26-
git config --global core.eol lf
27-
env
25+
ver
26+
wmic cpu get name, caption, maxclockspeed, status
27+
systeminfo
28+
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
29+
systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version"
30+
set
2831
ipconfig
2932
uname -a
3033
pwd
3134
ipconfig /all
3235
36+
- name: Prepare git
37+
run: |
38+
git config --global core.autocrlf false
39+
git config --global core.eol lf
40+
git config --global core.ignorecase false
41+
3342
- uses: actions/checkout@v4
3443
- name: set php version
3544
# 参考文档: https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
@@ -60,35 +69,46 @@ jobs:
6069

6170
- name: Install Cygwin
6271
uses: cygwin/cygwin-install-action@v2
72+
with:
73+
site: https://mirrors.kernel.org/sourceware/cygwin/
6374
# with:
6475
# platform: x64
6576
# 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
6677

67-
- name: Install Cygwin Packages
78+
- name: Install Cygwin Packages with bash
79+
if: 0
6880
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
6981
run: |
7082
ls -lah /cygdrive/c/
7183
ls -lah /cygdrive/d/
72-
7384
cp -f /cygdrive/c/setup.exe /cygdrive/c/cygwin/bin/setup-x86_64.exe
74-
7585
bash ./sapi/scripts/cygwin/install-cygwin.sh
7686
87+
- name: Install Cygwin Packages
88+
if: 1
89+
run: |
90+
Copy-Item -Path "C:\setup.exe" -Destination "${{ github.workspace }}\setup-x86_64.exe"
91+
cmd /c .\sapi\quickstart\windows\cygwin-build\install-cygwin.bat
92+
7793
- name: Install re2c
94+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
7895
run: |
7996
bash ./sapi/scripts/cygwin/install-re2c.sh
8097
81-
- name: Prepare
98+
- name: Configure
99+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
82100
run: |
83101
# git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli
84102
# git submodule update --init
85103
bash ./sapi/scripts/cygwin/cygwin-config-ext.sh --php-version ${{ env.BUILD_PHP_VERSION }}
86104
87105
- name: Configure
106+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
88107
run: |
89108
bash ./sapi/scripts/cygwin/cygwin-config.sh --php-version ${{ env.BUILD_PHP_VERSION }}
90109
91110
- name: Build
111+
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
92112
run: |
93113
bash ./sapi/scripts/cygwin/cygwin-build.sh
94114
@@ -141,8 +161,30 @@ jobs:
141161

142162
- name: gh release
143163
uses: softprops/action-gh-release@v2
144-
if: startsWith(github.ref, 'refs/tags/')
164+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
145165
env:
146166
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147167
with:
148168
files: php-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip
169+
170+
upload-to-cloud-object-storage:
171+
if: 0
172+
runs-on: ubuntu-latest
173+
needs: windows-cygwin
174+
steps:
175+
- name: Prepare Run Environment
176+
run:
177+
sudo apt install -y curl
178+
- uses: actions/checkout@v4
179+
- uses: actions/download-artifact@v4
180+
- name: upload artifacts to cloud object storage
181+
if: ${{ 0 && (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
182+
env:
183+
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
184+
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
185+
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
186+
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
187+
run: |
188+
FILE_NAME=$(ls -d swoole-cli-v*-cygwin-x64)
189+
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
190+
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${FILE}

docs/Cygwin.md

Lines changed: 31 additions & 7 deletions
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

0 commit comments

Comments
 (0)