From ac00ea0eaf629e7c12e3afb316271b3511a85c0d Mon Sep 17 00:00:00 2001 From: sy-records <52o@qq52o.cn> Date: Mon, 17 May 2021 16:21:42 +0800 Subject: [PATCH] Add Cygwin build --- .github/workflows/cygwin.yml | 76 ++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/cygwin.yml diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml new file mode 100644 index 00000000000..167b899417f --- /dev/null +++ b/.github/workflows/cygwin.yml @@ -0,0 +1,76 @@ +name: cygwin + +on: + push: + tags: + - 'v*' + +jobs: + build: + if: github.repository_owner == 'swoole' + runs-on: windows-latest + outputs: + version: ${{ steps.swoole_info.outputs.version }} + body: ${{ steps.swoole_info.outputs.upload_url }} + steps: + - name: Set up Cygwin + uses: egor-tensin/setup-cygwin@v3 + with: + platform: x64 + packages: cmake php php-devel gcc-g++ openssl libssl-devel libcurl-devel libpcre2-devel wget tar php-curl php-json php-sockets php-mysqli php-bcmath php-bz2 php-calendar php-ctype php-phar php-posix php-pspell php-exif php-recode php-fileinfo php-simplexml php-gd php-soap php-gettext php-sockets php-gmp php-gv php-iconv php-intl php-json php-tokenizer php-mbstring php-ming php-xmlreader php-xmlwriter php-opcache php-xsl php-zip php-pdo_mysql php-zlib php-redis + + - name: Get Swoole Info + id: swoole_info + run: | + wget https://api.github.com/repos/swoole/swoole-src/releases/latest -O latest + $g=cat .\latest | ConvertFrom-Json + $version=$g.tag_name + $upload_url=$g.upload_url + echo $version + echo $upload_url + echo "::set-output name=version::$version" + echo "::set-output name=upload_url::$upload_url" + + - name: Build Swoole + run: | + wget https://github.com/swoole/swoole-src/archive/${{ steps.swoole_info.outputs.version }}.tar.gz -O swoole.tar.gz + mkdir -p swoole + tar -xf swoole.tar.gz -C swoole --strip-components=1 + rm swoole.tar.gz + cd swoole + /bin/phpize + ./configure --enable-openssl --with-openssl_dir=/usr --enable-http2 --enable-mysqlnd + make -j6 + cp modules/swoole.dll /usr/lib/php/20180731 + echo 'extension=swoole.dll' > /etc/php.d/swoole.ini + php -v + php -m + php --ri swoole + php --ini + cd .. + shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + + - name: Run build + env: + VERSION: ${{ steps.swoole_info.outputs.version }} + run: | + C:\tools\php\php.exe -v + C:\tools\php\php.exe -m + wget https://github.com/lufei/cygwin/archive/refs/heads/master.tar.gz -O cygwin.tar.gz + mkdir -p swoole-cygwin + tar -xf cygwin.tar.gz -C swoole-cygwin --strip-components=1 + rm cygwin.tar.gz + cd swoole-cygwin + C:\tools\php\php.exe build.php + cd .. + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.swoole_info.outputs.upload_url }} + asset_path: .\swoole-cygwin\swoole-cygwin-${{ steps.swoole_info.outputs.version }}.zip + asset_name: swoole-cygwin-${{ steps.swoole_info.outputs.version }}.zip + asset_content_type: application/zip