Skip to content

Commit

Permalink
Merge pull request #900 from jingjingxyk/experiment-t
Browse files Browse the repository at this point in the history
pull main code
  • Loading branch information
jingjingxyk authored Jan 2, 2025
2 parents 5f46cbe + 3a746e3 commit d8743c5
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 138 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/artifact-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ jobs:
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (inputs.enable_upload_cloud_object_storage == true) }}
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-all --swoole-cli-version ${{ inputs.version }}
6 changes: 4 additions & 2 deletions .github/workflows/linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ jobs:
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz
6 changes: 4 additions & 2 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ jobs:
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz
6 changes: 4 additions & 2 deletions .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ jobs:
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz
6 changes: 4 additions & 2 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ jobs:
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz
8 changes: 5 additions & 3 deletions .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: |
bash ./sapi/scripts/cygwin/install-re2c.sh
- name: Prepare
- name: Configure
shell: C:\cygwin\bin\bash.EXE --noprofile --norc -e -o pipefail -o igncr {0}
run: |
# git config --global --add safe.directory /cygdrive/d/a/swoole-cli/swoole-cli
Expand Down Expand Up @@ -160,8 +160,10 @@ jobs:
- name: upload artifacts to cloud object storage
if: ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
env:
SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_SECRET_ID: ${{ secrets.QCLOUD_OSS_SECRET_ID }}
OSS_SECRET_KEY: ${{ secrets.QCLOUD_OSS_SECRET_KEY }}
OSS_BUCKET: ${{ vars.QCLOUD_OSS_BUCKET }}
OSS_REGION: ${{ vars.QCLOUD_OSS_REGION }}
run: |
FILE_NAME=$(ls -d swoole-cli-v*-cygwin-x64)
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
Expand Down
21 changes: 8 additions & 13 deletions sapi/quickstart/linux/arm64/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# x86_64 运行 arm64
> 使用 qemu-user-static 实现
# `x86_64` 平台模拟 `arm64`

## 参考文档
qemu
https://www.qemu.org/
https://github.com/qemu/qemu.git

qemu-user-static
https://github.com/multiarch/qemu-user-static.git
使用 `qemu-user-static` 实现

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

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


2 changes: 1 addition & 1 deletion sapi/quickstart/linux/connection-swoole-cli-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ __DIR__=$(

cd ${__DIR__}

docker exec -it swoole-cli-alpine-dev sh
docker exec -it woole-cli-builder sh
26 changes: 14 additions & 12 deletions sapi/quickstart/linux/extra/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#
# 常见问题

## 当环境中没有 PHP 解释器时 可以快速安装 PHP 解释器
```bash
## 快速安装 `PHP` 解释器

# alpine
### Alpine

sh sapi/quickstart/linux/extra/alpine-php-init.sh
```bash
sh sapi/quickstart/linux/extra/alpine-php-init.sh
```

## debian
### Debian/Ubuntu

```bash
bash sapi/quickstart/linux/extra/debian-php-init.sh

```

```bash
wget -O composer.phar https://mirrors.aliyun.com/composer/composer.phar
## 安装 `Composer`

```bash
wget -O composer.phar https://mirrors.aliyun.com/composer/composer.phar
```

## c c++编译器 组合
## `C/C++` 编译器组合

- 组合一 clang clang++
- 组合二 gcc g++
- `clang` + `clang++`
- `gcc` + `g++`

2 changes: 1 addition & 1 deletion sapi/quickstart/linux/install-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ ! -f /usr/libexec/docker/cli-plugins/docker-compose ]; then

# show more version info
# https://github.com/docker/compose/releases
VERSION="v2.29.1"
VERSION="v2.32.1"

curl -fsSL "https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Expand Down
12 changes: 6 additions & 6 deletions sapi/quickstart/linux/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ while [ $# -gt 0 ]; do
shift $(($# > 0 ? 1 : 0))
done


# https://github.com/docker/docker-install.git
# test -f get-docker.sh || curl -fsSL https://get.docker.com -o get-docker.sh

Expand All @@ -41,14 +40,15 @@ china | ustc | tuna)
;;
esac


if [ -n "$http_proxy" ] || [ -n "$https_proxy" ] || [ -n "$HTTP_PROXY" ] || [ -n "$HTTPS_PROXY" ]; then
echo 'Please delete proxy settings !'
echo 'Execute this script again !'
exit 0
set +u
unset http_proxy
unset https_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
set -u
fi


case "$MIRROR" in
china | ustc)
sed -i "s@https://mirrors.aliyun.com/docker-ce@https://mirrors.ustc.edu.cn/docker-ce@g" get-docker.sh
Expand Down
1 change: 0 additions & 1 deletion sapi/quickstart/linux/run-alpine-container-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ __PROJECT__=$(
cd ${__DIR__}

{
docker stop swoole-cli-alpine-dev
docker stop swoole-cli-builder
sleep 5
} || {
Expand Down
7 changes: 3 additions & 4 deletions sapi/quickstart/linux/run-alpine-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ __PROJECT__=$(
cd ${__DIR__}

{
docker stop swoole-cli-alpine-dev
docker stop swoole-cli-builder
sleep 5
} || {
Expand All @@ -28,9 +27,9 @@ while [ $# -gt 0 ]; do
--mirror)
MIRROR="$2"
case "$MIRROR" in
china | openatom)
IMAGE="hub.atomgit.com/library/alpine:3.18"
;;
china | openatom)
IMAGE="hub.atomgit.com/library/alpine:3.18"
;;
esac
;;
esac
Expand Down
7 changes: 3 additions & 4 deletions sapi/quickstart/linux/run-debian-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ while [ $# -gt 0 ]; do
--mirror)
MIRROR="$2"
case "$MIRROR" in
china | openatom)
IMAGE="hub.atomgit.com/library/debian:12"
;;
china | openatom)
IMAGE="hub.atomgit.com/library/debian:12"
;;
esac
;;
esac
shift $(($# > 0 ? 1 : 0))
done


cd ${__DIR__}
docker run --rm --name swoole-cli-debian-dev -d -v ${__PROJECT__}:/work -w /work --init $IMAGE tail -f /dev/null
16 changes: 0 additions & 16 deletions sapi/quickstart/windows/cygwin-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,5 @@ sapi\quickstart\windows\cygwin-build\install-cygwin.bat

```

# windows 软连接例子

```bash

mklink composer composer.phar

```

## 其他

1. [windows build native php](./windows-native.md)
1. [install msys2 ](./install-msys2.md)






7 changes: 3 additions & 4 deletions sapi/quickstart/windows/cygwin-build/install-cygwin.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
@echo off

:: cygwin site: https://cygwin.com/
:: start https://cygwin.com/setup-x86_64.exe

setlocal enableextensions enabledelayedexpansion


echo %~dp0
cd /d %~dp0
cd /d ..\..\..\..\

set "__PROJECT__=%cd%"
cd /d %__PROJECT__%\
echo %cd%
:: package separate with commas


set SITE="https://mirrors.kernel.org/sourceware/cygwin/"

:getopt
Expand All @@ -29,7 +31,6 @@ if "%GITHUB_ACTIONS%"=="" (
setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site %SITE%
)


setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --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

setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages zip unzip
Expand All @@ -38,6 +39,4 @@ setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disa

setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site %SITE% --packages libzstd-devel



endlocal
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,5 @@ pacman -Syy --noconfirm openssl-devel libreadline
# msys2 环境下 拉取 swoole-cli 源码
git clone --recursive https://github.com:swoole/swoole-cli.git

# msys2 环境下下载 cygwin (也可以用浏览器下载) 安装包
wget https://cygwin.com/setup-x86_64.exe

# 将 cygwin 安装包 移动到 window 指定盘符根目 (这里以 C盘为例)
mv setup-x86_64.exe C:/setup-x86_64.exe


```

### windows 自带默认终端

```shell

# windows 开始菜单,打开 新的 windows 自带终端,执行安装 cygwin
cd c:\

# 添加 pgsql
setup-x86_64.exe --no-desktop --no-shortcuts --no-startmenu --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages libpq5 libpq-deve

```
31 changes: 0 additions & 31 deletions sapi/quickstart/windows/windows-native.md

This file was deleted.

27 changes: 27 additions & 0 deletions sapi/quickstart/windows/windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 构建window PHP 工具 和 参考

[download windows PHP ](https://windows.php.net/download#php-8.2)

[windows build php 步骤](https://wiki.php.net/internals/windows/stepbystepbuild)

## windows 环境下 git 配置

```shell
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
git config core.ignorecase false # 设置 Git 在 Windows 上也区分大小写
```

[Latest VC++](https://learn.microsoft.com/en-AU/cpp/windows/latest-supported-vc-redist)
[7zip](https://7-zip.org/)
[visualstudio](https://visualstudio.microsoft.com/zh-hans/downloads/)
[windows-sdk](https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/)

## windows 软连接例子

```bash

mklink composer composer.phar

```
Loading

0 comments on commit d8743c5

Please sign in to comment.