-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ce5041
commit ac00ea0
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |