Skip to content

Commit

Permalink
Merge pull request #16 from jingjingxyk/dev
Browse files Browse the repository at this point in the history
optimize install.sh
  • Loading branch information
jingjingxyk authored Jul 15, 2024
2 parents 070a6e4 + 24f54ff commit 11f9178
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 225 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- name: native ubuntu install swoole
run: |
sudo sh .github/workflows/init.sh
sudo sh init.sh
sudo bash install.sh --install-php 1
- name: show info
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
- alpine:3.18
- rockylinux:9.3
- fedora:41
# - archlinux:latest
- archlinux:latest
- php:8.3-zts-alpine3.20
- php:8.2-zts-alpine3.20
- php:8.1-zts-alpine3.20
Expand All @@ -50,7 +50,7 @@ jobs:
image: ${{ matrix.container_image }}
options: -v ${{ github.workspace }}:/work -w /work
run: |
sh .github/workflows/init.sh
sh init.sh
bash install.sh --install-php 1
macos:
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/init.sh

This file was deleted.

45 changes: 29 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,34 @@ curl -fsSL https://gitee.com/jingjingxyk/swoole-install/raw/main/install.sh | b

```

## rhel 系 、alpine、archlinux 解决 `which` command no found

```bash

curl -fsSL https://github.com/swoole/installers/blob/main/init.sh?raw=true | bash

# mirror

curl -fsSL https://gitee.com/jingjingxyk/swoole-install/raw/main/init.sh | bash

```

## 支持的操作系统

| 操作系统 | 支持情况 |
|-------------------------------------------------|------|
| [debian](https://www.debian.org/) ||
| [ubuntu](https://ubuntu.com/) ||
| [rockylinux](https://rockylinux.org/) ||
| [almalinux](https://almalinux.org/) ||
| [alinux](https://www.aliyun.com/product/alinux) ||
| [anolis](https://openanolis.cn/anolisos) ||
| [fedora ](https://fedoraproject.org/) ||
| [alpine](https://www.alpinelinux.org/) ||
| [kali](https://www.kali.org/) ||
| [macos](https://www.apple.com/) ||
| wsl | |
| FreeBSD 13 | |
| [OpenEuler](https://www.openeuler.org/) ||
| Huawei Cloud EulerOS ||
| 操作系统 | 支持情况 |
|--------------------------------------------------------------|------|
| [debian](https://www.debian.org/) ||
| [ubuntu](https://ubuntu.com/) ||
| [rockylinux](https://rockylinux.org/) ||
| [almalinux](https://almalinux.org/) ||
| [Alibaba cloud liunx](https://www.aliyun.com/product/alinux) ||
| [anolis](https://openanolis.cn/anolisos) ||
| [fedora ](https://fedoraproject.org/) ||
| [alpine](https://www.alpinelinux.org/) ||
| [kali](https://www.kali.org/) ||
| [macos](https://www.apple.com/) ||
| wsl | |
| FreeBSD 13 | |
| [OpenEuler](https://www.openeuler.org/) ||
| Huawei Cloud EulerOS ||
| [archlinux](https://archlinux.org/) ||
2 changes: 1 addition & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ php --ini | grep ".ini files"
PHP_INI_SCAN_DIR=$(php --ini | grep "Scan for additional .ini files in:" | awk -F 'in:' '{ print $2 }' | xargs)

if [ -n "${PHP_INI_SCAN_DIR}" ] && [ -d "${PHP_INI_SCAN_DIR}" ]; then
SUDO=''
local SUDO=''
if [ ! -w "${PHP_INI_SCAN_DIR}" ] ; then
SUDO='sudo'
fi
Expand Down
24 changes: 24 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
OS=$(uname -s)
if [ "${OS}" == 'Linux' ]; then
OS_RELEASE=$(awk -F= '/^ID=/{print $2}' /etc/os-release | tr -d '\n' | tr -d '\"')
case "$OS_RELEASE" in
'rocky' | 'almalinux' | 'alinux' | 'anolis' | 'fedora' | 'openEuler' | 'hce') # | 'amzn' | 'ol' | 'rhel' | 'centos' # 未测试
yum update -y
yum install -y which
;;
'ubuntu')
if [ "$GITHUB_ACTIONS" = "true" ]; then
sed -i.bak "[email protected]@azure.archive.ubuntu.com@g" /etc/apt/sources.list
sed -i.bak "[email protected]@azure.archive.ubuntu.com@g" /etc/apt/sources.list
fi
;;
'alpine')
apk update
apk add bash
;;
'arch')
pacman -Syyu --noconfirm
pacman -Sy --noconfirm which
;;
esac
fi
Loading

0 comments on commit 11f9178

Please sign in to comment.