Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Jan 1, 2025
2 parents 7d5fbb8 + 03ff24f commit d290297
Show file tree
Hide file tree
Showing 335 changed files with 12,772 additions and 3,270 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/artifact-hash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: artifact-hash

on:
workflow_dispatch:
inputs:
version:
required: true
description: "发版 版本号 tag"
default: 'v1.7.1'
type: string
php-version:
required: true
description: "PHP 版本号 "
default: 'v8.1.31,v8.2.27,v8.3.15,v8.4.2'
type: string
enable_upload_cloud_object_storage:
required: false
type: boolean
description: "上传到云对象存储 (默认不需要上传)"

jobs:
generate-artifact-hash:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Show Release File Hash
run: |
bash sapi/scripts/generate-artifact-hash.sh --version ${{ inputs.version }} --php-version ${{ inputs.php-version }}
- name: production artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.version }}-sha256sum
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:
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 }}
9 changes: 4 additions & 5 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 All @@ -84,8 +84,8 @@ jobs:
composer install --no-interaction --no-autoloader --no-scripts --profile --no-dev
composer dump-autoload --optimize --profile --no-dev
php prepare.php +inotify +apcu +ds +xlswriter +ssh2 +uuid +mongodb --show-tarball-hash=1
php prepare.php +apcu +ds +xlswriter +ssh2 +uuid @macos --show-tarball-hash=1
php prepare.php +inotify --show-tarball-hash=1
php prepare.php @macos --show-tarball-hash=1
cd ${{ github.workspace }}/pool/
zip -9 -r ${WORK_DIR}/all-deps.zip ext lib
Expand All @@ -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
49 changes: 49 additions & 0 deletions .github/workflows/download-webrtc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: linux-download-ci

on:
push:
pull_request:

jobs:
download-webrtc:
runs-on: ubuntu-latest
if: 0
steps:
- uses: actions/checkout@v4
- name: prepare Environment
run: |
git config --global core.autocrlf false
# 不再关心文件的权限
git config --global core.filemode false
# 让 Git 显示颜色,会让命令输出看起来更醒目
git config --global color.ui true
sudo apt install -y curl wget bash
- name: Prepare depot_tools
run: |
# https://webrtc.googlesource.com/src/+/main/docs/native-code/development/prerequisite-sw/
# https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up
git clone --progress -b main https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=${{ github.workspace }}/depot_tools:$PATH
echo "PATH=$PATH:${{ github.workspace }}/depot_tools" >> $GITHUB_ENV
- name: Maximize build space
if: 1
shell: bash
run: |
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
df -h
- name: Download Webrtc
run: |
# https://webrtc.googlesource.com/src/+/main/docs/native-code/development
fetch webrtc
cd src && ./build/install-build-deps.sh
gclient sync
19 changes: 15 additions & 4 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.13
BUILD_PHP_VERSION: 8.2.27

jobs:
linux-aarch64:
Expand All @@ -12,9 +12,10 @@ jobs:
strategy:
matrix:
php-version:
- "8.2.13"
- "8.1.27"
# - "8.3.3"
- "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 @@ -207,3 +208,13 @@ 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:
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
8 changes: 7 additions & 1 deletion .github/workflows/linux-riscv64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ on: [ push, pull_request ]
jobs:
linux-riscv:
if: 0
runs-on: ubuntu-latest
runs-on:
# - ubuntu-latest
# https://github.com/apps/riscv-builders
# https://github.com/mengzhuo/GhostWrite/blob/main/.github/workflows/test.yml
- riscv-builders
- soc-spacemit-k1
- soc-starfive-jh7100
steps:
- uses: actions/checkout@v4
- name: Prepare Source Code
Expand Down
48 changes: 4 additions & 44 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,10 @@ name: build-linux-x86_64
on:
push:
pull_request:
workflow_dispatch:
inputs:
build_latest_swoole_or_swow:
required: true
description: "定制构建选项: 构建最新版的 swoole 或者 swow (此二者扩展不能同时启用)"
default: ' '
type: choice
options:
- ' '
- '-swoole +swoole_latest'
- '-swoole +swow_latest'
- '-swoole +swow'
php_version:
required: true
description: "定制构建选项: 指定 PHP 版本(版本号大于等于8.1)"
default: '--with-php-version=8.2.13'
type: choice
options:
- '--with-php-version=8.1.27'
- '--with-php-version=8.2.13'
- '--with-php-version=8.3.1'
build_type:
required: true
description: "定制构建选项: 指定构建类型"
default: '--with-build-type=release'
type: choice
options:
- '--with-build-type=release'
- '--with-build-type=dev'
build_options:
required: false
description: "定制构建选项: 请查看 docs/options.md"
default: ' '
type: string


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

jobs:
linux-x86_64:
Expand All @@ -51,6 +16,8 @@ jobs:
- uses: actions/checkout@v4
- name: Show Environment Info
run: |
echo "${{ github.event.head_commit.message }}"
echo "${{ github.event.workflow_run.head_commit.message }}"
echo $PATH
env
docker info
Expand Down Expand Up @@ -196,14 +163,6 @@ jobs:
bash ./make.sh build
bash ./make.sh archive
- name: Start Database
run: |
# 准备数据库容器
export PATH=/usr/libexec/docker/cli-plugins/:$PATH
docker-compose version
docker container ls -a
# bash sapi/src/UnitTest/scripts/database/start.sh
- name: Show Build Result
run: |
./bin/aria2c -v
Expand All @@ -225,3 +184,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: aria2c-${{ env.APP_VERSION }}-linux-x64.tar.xz

28 changes: 10 additions & 18 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.13
BUILD_PHP_VERSION: 8.2.27

jobs:
macos-aarch64:
Expand All @@ -17,7 +17,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Prepare build environment
- name: Show Environment Info
run: |
set -x
uname -s
Expand All @@ -26,24 +26,12 @@ jobs:
sysctl -n hw.ncpu
env
echo $HOME
sw_vers
xcodebuild -version
brew config
bash sapi/quickstart/macos/macos-init.sh
# sudo rm -rf /Library/Developer/CommandLineTools
# xcode-select --install
# sudo xcode-select --reset
# sudo xcode-select -switch /Library/Developer/CommandLineTools
# softwareupdate --list --verbose
# softwareupdate --install -a
# xcode-select --install
# export SDKROOT=$(xcrun --show-sdk-path)
xcrun --show-sdk-path
ls -lh $(xcrun --show-sdk-path)
# sudo xcode-select --switch /Applications/Xcode.app
# export MACOSX_DEPLOYMENT_TARGET=12.6
clang --version
ifconfig
export IPV6=$(ifconfig en0 | grep "inet6 " | grep -v "inet6 fe80:" | awk '{print $2}' | cut -d'/' -f1 | sed -n '2p')
Expand All @@ -55,6 +43,10 @@ jobs:
# echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
- name: Prepare Build Environment
run: |
bash sapi/quickstart/macos/macos-init.sh
export PATH="/opt/homebrew/opt/libtool/bin:$PATH"
ls -lha /opt/homebrew/opt/libtool/bin/
libtoolize --version
Expand Down
42 changes: 22 additions & 20 deletions .github/workflows/macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,45 @@ on:
pull_request:

env:
BUILD_PHP_VERSION: 8.2.13
BUILD_PHP_VERSION: 8.2.27

jobs:
macos-x86_64:
if: 1
runs-on: macos-12
runs-on: macos-13
# macos-latest (macos-14) 变更了 CPU 架构,由 x86_64 变更为 arm64
# macos-14 CPU 架构 arm64
# macos-13 CPU 架构 x86_64
# macos-12 CPU 架构 x86_64
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners

steps:
- uses: actions/checkout@v4
- name: Prepare build environment
- name: Show Environment Info
run: |
set -x
uname -s
uname -m
uname -r
sysctl -n hw.ncpu
env
echo $HOME
sw_vers
xcodebuild -version
brew config
set -x
bash sapi/quickstart/macos/macos-init.sh
# sudo rm -rf /Library/Developer/CommandLineTools
# xcode-select --install
xcrun --show-sdk-path
clang --version
# sudo xcode-select --reset
# sudo xcode-select -switch /Library/Developer/CommandLineTools
# softwareupdate --list --verbose
# softwareupdate --install -a
# xcode-select --install
# xcode-select --print-path
# export SDKROOT=$(xcrun --show-sdk-path)
ls -lh $(xcrun --show-sdk-path)
# sudo xcode-select --switch /Applications/Xcode.app
# export MACOSX_DEPLOYMENT_TARGET=12.6
# find /Applications/Xcode.app -name stdio.h
xcodebuild -find make
xcodebuild -find gcc
xcodebuild -find g++
xcodebuild -find clang
xcodebuild -find clang++
find /Applications/Xcode.app -path '*/usr/include/stdio.h'
find $(xcode-select --print-path) -name stdio.h
echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> /Users/runner/.bash_profile
Expand All @@ -59,6 +57,10 @@ jobs:
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
- name: Prepare Build Environment
run: |
bash sapi/quickstart/macos/macos-init.sh
export PATH=/usr/local/opt/libtool/bin:$PATH
ls -lha /usr/local/opt/libtool/bin/
Expand Down
Loading

0 comments on commit d290297

Please sign in to comment.