1- name : build-swoole-cli-linux-glibc-x86_64
1+ name : build-swoole-cli-linux-glibc
22
33on : [ push, pull_request ]
44
1212 name : linux-glibc-${{ matrix.os }}
1313 runs-on : ${{ matrix.os }}
1414 steps :
15- - uses : actions/checkout@v4
15+ - uses : actions/checkout@v5
1616 - name : Show Environment Info
1717 run : |
1818 echo $PATH
@@ -49,34 +49,13 @@ jobs:
4949
5050 mkdir -p ${{ github.workspace }}/var/build-github-action-container/
5151
52- - name : Cache PHP Runtime
53- uses : actions/cache@v4
54- id : php-runtime-cache-x86_64
55- with :
56- path : ${{ github.workspace }}/runtime
57- key : ${{ runner.os }}-x86_64-php-runtime
58-
59- - name : Cache PHP Vendor
60- uses : actions/cache@v4
61- id : php-vendor-cache-x86_64
62- with :
63- path : ${{ github.workspace }}/vendor
64- key : ${{ runner.os }}-x86_64-php-vendor
65-
6652 - name : Cache Dependency Source Code Tarball
67- uses : actions/cache@v4
53+ uses : actions/cache@v5
6854 id : pool-cache
6955 with :
7056 path : ${{ github.workspace }}/pool/
7157 key : source-code-tarball-pool
7258
73- - name : Cache all-library
74- uses : actions/cache@v4
75- id : all-library-cache-x86_64
76- with :
77- path : /usr/local/swoole-cli
78- key : ${{ github.head_ref || github.ref_name }}-${{ runner.os }}-x86_64-all-library
79-
8059 - name : Prepare Runtime and Libraries and Extensions
8160 run : |
8261 set -x
8564 mkdir -p bin/
8665 mkdir -p runtime/
8766 test -f runtime/php && rm -f runtime/php
88- if [ ! -f runtime/php/php ] ; then
67+ if [ ! -f runtime/php/box ] ; then
8968 bash setup-php-runtime.sh
9069 fi
9170 bash sapi/download-box/download-box-get-archive-from-server.sh
@@ -99,11 +78,11 @@ jobs:
9978 composer install --no-interaction --no-autoloader --no-scripts --profile
10079 composer dump-autoload --optimize --profile
10180
102- php prepare.php --with-libavif
81+ php prepare.php --with-libavif --without-docker --with-iouring
10382
10483 sudo apt update
105- bash ./sapi/scripts/install-deps-on-ubuntu.sh
106- bash ./ext/swoole/scripts/install-deps-on-ubuntu.sh
84+ sudo bash ./sapi/scripts/install-deps-on-ubuntu.sh
85+ sudo bash ./ext/swoole/scripts/install-deps-on-ubuntu.sh
10786 bash ./sapi/scripts/build-swoole-cli-with-linux-gcc.sh
10887
10988 ./bin/swoole-cli -v
11493 ./bin/swoole-cli --ri swoole
11594 { ldd ./bin/swoole-cli ; } || { echo $? ; } ;
11695 file ./bin/swoole-cli
96+ APP_VERSION=$(./bin/swoole-cli -v | awk '{print $2}')
97+ echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
11798
11899 - name : Make nfpm package
119100 run : |
@@ -130,6 +111,38 @@ jobs:
130111 ls -ls ./*.deb
131112 ls -ls ./*.rpm
132113
114+ ARCH=$(uname -m)
115+ if [ "$ARCH" = "aarch64" ]; then
116+ FILE_ARCH="arm64"
117+ else
118+ FILE_ARCH="x64"
119+ fi
120+ OS="linux"
121+ echo "FILE_ARCH=${FILE_ARCH}" >> $GITHUB_ENV
122+ echo "OS=${OS}" >> $GITHUB_ENV
123+
124+ - name : production artifacts debian
125+ uses : actions/upload-artifact@v5
126+ with :
127+ name : swoole-cli-glibc-for-debian-${{ env.FILE_ARCH }}
128+ retention-days : 90
129+ path : ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.deb
130+
131+ - name : production artifacts redhat
132+ uses : actions/upload-artifact@v5
133+ with :
134+ name : swoole-cli-glibc-for-redhat-${{ env.FILE_ARCH }}
135+ retention-days : 90
136+ path : ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.rpm
137+
138+ - name : gh release
139+ uses : softprops/action-gh-release@v2
140+ if : startsWith(github.ref, 'refs/tags/')
141+ with :
142+ files : |
143+ ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.deb
144+ ${{ github.workspace }}/swoole-cli-v${{ env.APP_VERSION }}-${{ env.OS }}-${{ env.FILE_ARCH }}-glibc.rpm
145+
133146 - name : upload artifacts to cloud object storage
134147 if : ${{ (github.repository == 'swoole/swoole-cli') && (startsWith(github.ref, 'refs/tags/')) }}
135148 env :
@@ -138,13 +151,5 @@ jobs:
138151 OSS_BUCKET : ${{ vars.QCLOUD_OSS_BUCKET }}
139152 OSS_REGION : ${{ vars.QCLOUD_OSS_REGION }}
140153 run : |
141- ARCH=$(uname -m)
142- if [ "$ARCH" = "aarch64" ]; then
143- FILE_ARCH="arm64"
144- else
145- FILE_ARCH="x64"
146- fi
147- SWOOLE_VERSION=$(awk 'NR==1{ print $1 }' "sapi/SWOOLE-VERSION.conf")
148- OS="linux"
149- bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-"${SWOOLE_VERSION}-${OS}-${FILE_ARCH}"-glibc.deb
150- bash sapi/scripts/tencent-cloud-object-storage.sh --upload-file ${{ github.workspace }}/swoole-cli-"${SWOOLE_VERSION}-${OS}-${FILE_ARCH}"-glibc.rpm
154+ 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
155+ 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
0 commit comments