Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Aug 9, 2024
2 parents 6d9d2f1 + 08fa4b9 commit 0b17798
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 21 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/auto-cache-pool-tarball.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ jobs:
path: ${{ github.workspace }}/pool/
key: source-code-tarball-pool

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

- name: Prepare Runtime and Libraries and Extensions
run: |
set -x
Expand All @@ -79,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 +pgsql +mongodb --with-libavif=1 --show-tarball-hash=1
php prepare.php +apcu +ds +xlswriter +ssh2 +pgsql --with-libavif=1 @macos --show-tarball-hash=1
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
cd ${{ github.workspace }}/pool/
zip -9 -r ${WORK_DIR}/all-deps.zip ext lib
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ jobs:
# git submodule update --init
echo "BUILD_PHP_VERSION=${{ matrix.php-version }}" >> $GITHUB_ENV
# 准备数据库容器
docker-compose version
bash sapi/src/UnitTest/scripts/database/start.sh
sudo mkdir -p /usr/local/swoole-cli
uid=$(id -u) && gid=$(id -g) && sudo chown -R ${uid}:${gid} /usr/local/swoole-cli
Expand Down Expand Up @@ -164,6 +160,14 @@ 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: |
ls ./bin/coturn/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cp -f ./bin/runtime/coturn/etc/turnserver.conf.default ./bin/runtime/coturn/etc/

```

## `static-coturn`构建文档
## 构建文档

- [linux 版构建文档](docs/linux.md)
- [macOS 版构建文档](docs/macOS.md)
Expand Down
10 changes: 1 addition & 9 deletions prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,10 @@


$c_compiler = $p->getInputOption('with-c-compiler');
if ($c_compiler == 'musl-gcc') {
$p->set_C_COMPILER('musl-gcc');
$p->set_CXX_COMPILER('g++');
$p->setLinker('ld');
} elseif ($c_compiler == 'gcc') {
if ($c_compiler == 'gcc') {
$p->set_C_COMPILER('gcc');
$p->set_CXX_COMPILER('g++');
$p->setLinker('ld');
} elseif ($c_compiler == 'x86_64-linux-musl-gcc') {
$p->set_C_COMPILER('x86_64-linux-musl-gcc');
$p->set_CXX_COMPILER('x86_64-linux-musl-g++');
$p->setLinker('ld');
}

if ($p->getInputOption('with-build-shared-lib')) {
Expand Down
4 changes: 2 additions & 2 deletions sapi/download-box/download-box-get-archive-from-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ if [ -f "${__PROJECT__}/sapi/PHP-VERSION.conf" ] ; then
DOMAIN='https://github.com/swoole/swoole-cli/releases/download/v5.1.3.0/'
ALL_DEPS_HASH="5fa1485c2408f05cbc548712917e6dbb8ecd5a631b558d6d512d4a6671f071e5"
else
DOMAIN='https://github.com/swoole/build-static-php/releases/download/v1.2.1/'
ALL_DEPS_HASH="feb997287d2e906175da9369788ca995205f374745d9070e2bf227c875467fa4"
DOMAIN='https://github.com/swoole/build-static-php/releases/download/v1.3.2/'
ALL_DEPS_HASH="15769d1003213bf8849ac73bf96bc7629b138a694e8367fb2139756e20c2901d"
fi

while [ $# -gt 0 ]; do
Expand Down
6 changes: 6 additions & 0 deletions sapi/quickstart/clean-folder-for-extra-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ test -f setup-socat-runtime.sh && rm -rf setup-socat-runtime.sh
test -f setup-supervisord.sh && rm -rf setup-supervisord.sh
test -f setup-swoole-cli-pre-runtime.sh && rm -rf setup-swoole-cli-pre-runtime.sh
test -f setup-webBenchmark-runtime.sh && rm -rf setup-webBenchmark-runtime.sh
test -f setup-swow-cli-runtime.sh && rm -rf setup-swow-cli-runtime.sh
test -f setup-php-fpm-7.4-runtime.sh && rm -rf setup-php-fpm-7.4-runtime.sh
test -f setup-swoole-cli-runtime.sh && rm -rf setup-swoole-cli-runtime.sh
test -f setup-php-cli-7.4-runtime.sh && rm -rf setup-php-cli-7.4-runtime.sh
test -f setup-php-cli-7.3-runtime.sh && rm -rf setup-php-cli-7.3-runtime.sh


cd ${__PROJECT__}

echo '删除完毕'
echo ''


1 change: 1 addition & 0 deletions sapi/quickstart/linux/alpine-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ apk add python3-dev
apk add mercurial
apk add gettext-dev
apk add pigz parallel
apk add gnupg

case "$MIRROR" in
china | tuna | ustc)
Expand Down
1 change: 1 addition & 0 deletions sapi/quickstart/linux/debian-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ apt install -y python3 python3-pip ninja-build diffutils
apt install -y yasm nasm
apt install -y meson
apt install -y netcat-openbsd socat
apt install -y gnupg

case "$MIRROR" in
china | tuna | ustc)
Expand Down
5 changes: 5 additions & 0 deletions sapi/quickstart/linux/extra/archlinux-php-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pacman -Sy --noconfirm git curl wget openssl which
pacman -Sy --noconfirm cmake autoconf libtool make gcc
pacman -Sy --noconfirm pkg-config unixodbc c-are
pacman -Sy --noconfirm extra/php
pacman -Sy --noconfirm extra/php-redis extra/php-pgsql extra/php-sqlite
35 changes: 35 additions & 0 deletions sapi/quickstart/linux/install-docker-compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

set -ex
__DIR__=$(
cd "$(dirname "$0")"
pwd
)
__PROJECT__=$(
cd ${__DIR__}/../../../
pwd
)
cd ${__PROJECT__}

if ! docker info >/dev/null 2>&1; then
echo "This script uses docker, and it isn't running - please start docker and try again!"
echo "Docker does not seem to be running, run it first and retry"
exit 1
fi

docker info
ls -lh /usr/libexec/docker/cli-plugins/

if [ ! -f /usr/libexec/docker/cli-plugins/docker-compose ]; then

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

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

chmod +x /usr/local/bin/docker-compose

fi

docker-compose --version
1 change: 1 addition & 0 deletions sapi/quickstart/macos/macos-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ brew install libtool gettext coreutils libunistring pkg-config cmake
# macos 环境下 Homebrew packages : coreutils binutils 不兼容
# 详见: https://github.com/pyenv/pyenv/wiki/Common-build-problems#keg-only-homebrew-packages-are-forcibly-linked--added-to-path
brew install jq mercurial
brew install gnupg

# 已安装的包 跳过安装
# PACKAGES_1=(wget curl libtool automake re2c llvm flex bison m4 autoconf)
Expand Down
2 changes: 1 addition & 1 deletion sapi/src/builder/library/libiconv.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
->withManual('https://www.gnu.org/software/libiconv/')
->withLicense('https://www.gnu.org/licenses/old-licenses/gpl-2.0.html', Library::LICENSE_GPL)
//->withUrl('https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz')
->withUrl('https://ftpmirror.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz')
->withUrl('https://ftpmirror.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz')
->withMirrorUrl('https://mirrors.tuna.tsinghua.edu.cn/gnu/libiconv/libiconv-1.17.tar.gz')
->withMirrorUrl('https://mirrors.ustc.edu.cn/gnu/libiconv/libiconv-1.17.tar.gz')

Expand Down
5 changes: 4 additions & 1 deletion sapi/src/template/make.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@
container=$(docker ps -a -f name=<?= Preprocessor::CONTAINER_NAME ?> | tail -n +2 2> /dev/null)
base_image=$(docker images <?= Preprocessor::IMAGE_NAME ?>:<?= $this->getBaseImageTag() ?> | tail -n +2 2> /dev/null)
image=$(docker images <?= Preprocessor::IMAGE_NAME ?>:<?= $this->getImageTag() ?> | tail -n +2 2> /dev/null)
CONTAINER_STATE=$(docker inspect -f {{.State.Running}} <?= Preprocessor::CONTAINER_NAME ?> 2> /dev/null)
CONTAINER_STATE=$(docker inspect -f "{{.State.Running}}" <?= Preprocessor::CONTAINER_NAME ?> 2> /dev/null)
if [[ "${CONTAINER_STATE}" != "true" ]]; then
bash ./make.sh docker-stop
container=''
Expand All @@ -745,6 +745,9 @@
else
echo "<?= Preprocessor::IMAGE_NAME ?>:<?= $this->getImageTag() ?> image does not exist, try to pull"
echo "create container with <?= Preprocessor::IMAGE_NAME ?>:<?= $this->getImageTag() ?> image"
# check container image exists
# curl -fsSlL --head https://hub.docker.com/v2/repositories/$1/tags/$2/ > /dev/null && echo "exist" || echo "not exists"
# curl -fsSlL --head https://hub.docker.com/v2/repositories/<?= Preprocessor::IMAGE_NAME ?>/tags/<?= $this->getImageTag() ?>/ > /dev/null && echo "container image exist" || echo "container image not exists"
docker run -d --name <?= Preprocessor::CONTAINER_NAME ?> -v ${__PROJECT_DIR__}:/work <?= Preprocessor::IMAGE_NAME ?>:<?= $this->getImageTag() ?> tini -- tail -f /dev/null
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion setup-php-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ case $ARCH in
'x86_64')
ARCH="x64"
;;
'aarch64' | 'arm64' )
'aarch64' | 'arm64')
ARCH="arm64"
;;
*)
Expand Down

0 comments on commit 0b17798

Please sign in to comment.