-
Notifications
You must be signed in to change notification settings - Fork 44
155 lines (136 loc) · 5.63 KB
/
Copy pathlinux-glibc.yml
File metadata and controls
155 lines (136 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: build-swoole-cli-linux-glibc
on: [ push, pull_request ]
jobs:
linux-glibc:
if: ${{ !contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[linux-glibc]') }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, ubuntu-22.04-arm ]
name: linux-glibc-${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Show Environment Info
run: |
echo $PATH
env
docker info
id -u
id -g
who
cat /etc/os-release
hostnamectl
uname -s
uname -m
uname -r
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
cat /proc/cpuinfo | grep "cpu cores" | uniq
cat /proc/cpuinfo| grep "processor"| wc -l
lscpu
export IPV6=$(ip -6 address show | grep inet6 | awk '{print $2}' | cut -d'/' -f1 | sed -n '2p')
export IPV4=$(ip -4 address show | grep inet | grep -v 127.0.0 | awk '{print $2}' | cut -d'/' -f1 | sed -n '1p')
echo $IPV4
echo $IPV6
echo "X_IPV6=${IPV6}" >> $GITHUB_ENV
echo "X_IPV4=${IPV4}" >> $GITHUB_ENV
- name: Prepare Build Environment
run: |
git submodule update --init
sudo mkdir -p /usr/local/swoole-cli
uid=$(id -u) && gid=$(id -g) && sudo chown -R ${uid}:${gid} /usr/local/swoole-cli
mkdir -p ${{ github.workspace }}/var/build-github-action-container/
- name: Cache Dependency Source Code Tarball
uses: actions/cache@v5
id: pool-cache
with:
path: ${{ github.workspace }}/pool/
key: source-code-tarball-pool
- name: Prepare Runtime and Libraries and Extensions
run: |
set -x
mkdir -p pool/lib
mkdir -p pool/ext
mkdir -p bin/
mkdir -p runtime/
test -f runtime/php && rm -f runtime/php
if [ ! -f runtime/php/box ] ; then
bash setup-php-runtime.sh
fi
bash sapi/download-box/download-box-get-archive-from-server.sh
ls -A pool/lib/
ls -A /usr/local/swoole-cli/
- name: Build
run: |
set -eux
uname -m
composer install --no-interaction --no-autoloader --no-scripts --profile
composer dump-autoload --optimize --profile
php prepare.php --with-libavif --with-iouring
sudo apt update
sudo bash ./sapi/scripts/install-deps-on-ubuntu.sh
sudo bash ./ext/swoole/scripts/install-deps-on-ubuntu.sh
bash ./sapi/scripts/build-swoole-cli-with-linux-gcc.sh
./bin/swoole-cli -v
./bin/swoole-cli -m
./bin/swoole-cli --ri curl
./bin/swoole-cli --ri gd
./bin/swoole-cli --ri imagick
./bin/swoole-cli --ri swoole
{ ldd ./bin/swoole-cli ; } || { echo $? ; } ;
file ./bin/swoole-cli
APP_VERSION=$(./bin/swoole-cli -v | awk '{print $2}')
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
- name: Make nfpm package
run: |
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ]; then
NFPM_ARCH="arm64"
else
NFPM_ARCH="amd64"
fi
wget https://github.com/goreleaser/nfpm/releases/download/v2.43.4/nfpm_2.43.4_${NFPM_ARCH}.deb
sudo dpkg -i nfpm_2.43.4_${NFPM_ARCH}.deb
strip ./bin/swoole-cli
./make.sh nfpm-pkg
ls -ls ./*.deb
ls -ls ./*.rpm
ARCH=$(uname -m)
if [ "$ARCH" = "aarch64" ]; then
FILE_ARCH="arm64"
else
FILE_ARCH="x64"
fi
OS="linux"
echo "FILE_ARCH=${FILE_ARCH}" >> $GITHUB_ENV
echo "OS=${OS}" >> $GITHUB_ENV
- name: production artifacts debian
uses: actions/upload-artifact@v5
with:
name: swoole-cli-glibc-for-debian-${{ env.FILE_ARCH }}
retention-days: 90
path: ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.deb
- name: production artifacts redhat
uses: actions/upload-artifact@v5
with:
name: swoole-cli-glibc-for-redhat-${{ env.FILE_ARCH }}
retention-days: 90
path: ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.rpm
- name: gh release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.deb
${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.rpm
- name: upload artifacts to cloud object storage
if: ${{ (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 }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.deb
bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.rpm