Skip to content

Commit

Permalink
merge code
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Dec 21, 2024
2 parents c74c94b + 0517916 commit 47819ad
Show file tree
Hide file tree
Showing 22 changed files with 360 additions and 73 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/artifact-hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
description: "PHP 版本号 "
default: 'v8.1.30,v8.2.25,v8.3.13,v8.4.1'
type: string
enable_upload_cloud_object_storage:
required: false
type: boolean
description: "上传到云对象存储 (默认不需要上传)"

jobs:
generate-artifact-hash:
Expand All @@ -30,3 +34,12 @@ jobs:
retention-days: 90
path: |
${{ inputs.version }}-sha256sum
- name: upload artifacts to cloud object storage
if: ${{ 0 && (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 }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-all --swoole-cli-version ${{ inputs.version }}
5 changes: 2 additions & 3 deletions .github/workflows/auto-cache-pool-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
key: source-code-tarball-pool

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

Expand Down Expand Up @@ -100,7 +100,6 @@ jobs:
ls -A pool/ext/
- name: production artifacts
if: 1
uses: actions/upload-artifact@v4
with:
name: all-deps
Expand All @@ -111,7 +110,7 @@ jobs:
- name: gh release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: |
all-deps.zip
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/linux-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build-linux-aarch64
on: [ push, pull_request ]

env:
BUILD_PHP_VERSION: 8.2.25
BUILD_PHP_VERSION: 8.2.27

jobs:
linux-aarch64:
Expand All @@ -12,10 +12,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.2.25"
- "8.1.30"
- "8.3.13"
- "8.4.1"
- "8.2.27"
- "8.1.31"
- "8.3.15"
- "8.4.2"
steps:
- uses: actions/checkout@v4
- name: Show Environment Info
Expand Down Expand Up @@ -208,3 +208,11 @@ jobs:
files: |
php-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz
php-cli-v${{ env.APP_VERSION }}-linux-arm64-debug.tar.xz
- name: upload artifacts to cloud object storage
if: ${{ 0 && (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 }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-arm64.tar.xz
19 changes: 14 additions & 5 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ on:

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BUILD_PHP_VERSION: 8.2.25
BUILD_PHP_VERSION: 8.2.27

jobs:
linux-x86_64:
Expand All @@ -50,10 +50,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.2.25"
- "8.1.30"
- "8.3.13"
- "8.4.1"
- "8.2.27"
- "8.1.31"
- "8.3.15"
- "8.4.2"
steps:
- uses: actions/checkout@v4
- name: Show Environment Info
Expand Down Expand Up @@ -255,3 +255,12 @@ jobs:
files: |
php-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz
php-cli-v${{ env.APP_VERSION }}-linux-x64-debug.tar.xz
- name: upload artifacts to cloud object storage
if: ${{ 0 && (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 }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-linux-x64.tar.xz
18 changes: 13 additions & 5 deletions .github/workflows/macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build-macos-aarch64
on: [ push, pull_request ]

env:
BUILD_PHP_VERSION: 8.2.25
BUILD_PHP_VERSION: 8.2.27

jobs:
macos-aarch64:
Expand All @@ -17,10 +17,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.2.25"
- "8.1.30"
- "8.3.13"
- "8.4.1"
- "8.2.27"
- "8.1.31"
- "8.3.15"
- "8.4.2"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -169,3 +169,11 @@ jobs:
files: |
php-cli-v${{ env.BUILD_PHP_VERSION }}-macos-arm64.tar.xz
php-cli-v${{ env.BUILD_PHP_VERSION }}-macos-arm64-debug.tar.xz
- name: upload artifacts to cloud object storage
if: ${{ 0 && (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 }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-arm64.tar.xz
19 changes: 13 additions & 6 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

env:
BUILD_PHP_VERSION: 8.2.25
BUILD_PHP_VERSION: 8.2.27

jobs:
macos-x86_64:
Expand All @@ -20,11 +20,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.2.25"
- "8.1.30"
- "8.3.13"
- "8.4.1"

- "8.2.27"
- "8.1.31"
- "8.3.15"
- "8.4.2"
steps:
- uses: actions/checkout@v4
- name: Show Environment Info
Expand Down Expand Up @@ -190,3 +189,11 @@ jobs:
files: |
php-cli-v${{ env.BUILD_PHP_VERSION }}-macos-x64.tar.xz
php-cli-v${{ env.BUILD_PHP_VERSION }}-macos-x64-debug.tar.xz
- name: upload artifacts to cloud object storage
if: ${{ 0 && (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 }}
run: |
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-macos-x64.tar.xz
4 changes: 4 additions & 0 deletions .github/workflows/runner-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

[runner-images](https://github.com/actions/runner-images/tree/main/images)

[images](https://github.com/actions/runner-images/tree/main/images)
1 change: 0 additions & 1 deletion .github/workflows/runner-os-readme.md

This file was deleted.

55 changes: 42 additions & 13 deletions .github/workflows/windows-cygwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,40 @@ on:
pull_request:

env:
BUILD_PHP_VERSION: 8.2.25
BUILD_PHP_VERSION: 8.2.27

jobs:
windows-cygwin:
if: 0
runs-on: windows-latest
runs-on: windows-2022
strategy:
matrix:
php-version:
- "8.2.25"
- "8.1.30"
- "8.3.13"
- "8.4.1"

- "8.2.27"
- "8.1.31"
- "8.3.15"
- "8.4.2"
steps:
- name: Prepare git
- name: Show Environment Info
shell: cmd
run: |
git config --global core.autocrlf false
git config --global core.eol lf
ver
wmic cpu get name, caption, maxclockspeed, status
systeminfo
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
systeminfo | findstr /B /C:"Manufacturer" /C:"Product" /C:"Version"
env
ipconfig
uname -a
pwd
ipconfig /all
- name: Prepare git
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.ignorecase false
- uses: actions/checkout@v4
- name: set php version
# 参考文档: https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
Expand Down Expand Up @@ -60,6 +69,8 @@ jobs:

- name: Install Cygwin
uses: cygwin/cygwin-install-action@v2
with:
site: https://mirrors.kernel.org/sourceware/cygwin/
# with:
# platform: x64
# 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
Expand All @@ -69,9 +80,7 @@ jobs:
run: |
ls -lah /cygdrive/c/
ls -lah /cygdrive/d/
cp -f /cygdrive/c/setup.exe /cygdrive/c/cygwin/bin/setup-x86_64.exe
bash ./sapi/scripts/cygwin/install-cygwin.sh
- name: Install re2c
Expand Down Expand Up @@ -141,8 +150,28 @@ jobs:

- name: gh release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: php-cli-v${{ env.APP_VERSION }}-cygwin-x64.zip

upload-to-cloud-object-storage:
if: 1
runs-on: ubuntu-latest
needs: windows-cygwin
steps:
- name: Prepare Run Environment
run:
sudo apt install -y curl
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: upload artifacts to cloud object storage
if: ${{ 0 && (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 }}
run: |
FILE_NAME=$(ls -d swoole-cli-v*-cygwin-x64)
FILE="${{ github.workspace }}/${FILE_NAME}/${FILE_NAME}.zip"
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${FILE}
6 changes: 3 additions & 3 deletions prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@


# PHP 默认版本 (此文件配置 /sapi/PHP-VERSION.conf 在 build_native_php分支 和 衍生分支 无效)
$php_version = '8.2.23';
$php_version_id = '802023';
$php_version_tag = 'php-8.2.23';
$php_version = '8.2.27';
$php_version_id = '802027';
$php_version_tag = 'php-8.2.27';

if ($p->getInputOption('with-php-version')) {
$subject = $p->getInputOption('with-php-version');
Expand Down
10 changes: 5 additions & 5 deletions sapi/download-box/download-box-get-archive-from-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ mkdir -p ${__PROJECT__}/var/download-box/
cd ${__PROJECT__}/var/download-box/

if [ -f "${__PROJECT__}/sapi/PHP-VERSION.conf" ]; then
DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v5.1.5.1/'
ALL_DEPS_HASH="bdd159b93fd8217e89d206aeb22bf7a8295553db0aff332f049b9025feb31766"
DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v6.0.0.0/'
ALL_DEPS_HASH="a55699ecee994032f33266dfa37eabb49f1f6d6b6b65cdcf7b881cac09c63bea"
else
DOMAIN='https://github.com/swoole/build-static-php/releases/download/v1.5.2/'
ALL_DEPS_HASH="9408a86d9e50a07548eb11406f2448599e792cac3c999dcb35d308790c18e3ba"
DOMAIN='https://github.com/swoole/build-static-php/releases/download/v1.6.0/'
ALL_DEPS_HASH="771f8c695477be93da10847f3051fb054f0f829b242300e1ae2126b67f338664"
fi

while [ $# -gt 0 ]; do
Expand All @@ -45,7 +45,7 @@ done

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

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

# https://www.runoob.com/linux/linux-comm-unzip.html
# -o 不必先询问用户,unzip执行后覆盖原有文件。
Expand Down
22 changes: 21 additions & 1 deletion sapi/quickstart/windows/cygwin-build/download-cygwin.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
@echo off
:: cygwin site: https://cygwin.com/
start https://cygwin.com/setup-x86_64.exe
:: start https://cygwin.com/setup-x86_64.exe

setlocal


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

set "__PROJECT__=%cd%"
echo %cd%

md %__PROJECT__%\var\windows-cygwin-build-deps\

cd /d %__PROJECT__%\var\windows-cygwin-build-deps\

curl.exe -fSLo setup-x86_64.exe https://cygwin.com/setup-x86_64.exe

copy .\setup-x86_64.exe %__PROJECT__%\ /Y /Q

endlocal
13 changes: 13 additions & 0 deletions sapi/quickstart/windows/cygwin-build/install-cygwin.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
@echo off
:: cygwin site: https://cygwin.com/
:: start https://cygwin.com/setup-x86_64.exe

setlocal


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

set "__PROJECT__=%cd%"
echo %cd%
:: cygwin安装多个包,包之间,用逗号分隔

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
Expand All @@ -10,3 +22,4 @@ setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirr
setup-x86_64.exe --quiet-mode --disable-buggy-antivirus --site https://mirrors.ustc.edu.cn/cygwin/ --packages libzstd-devel


endlocal
Loading

0 comments on commit 47819ad

Please sign in to comment.