-
Notifications
You must be signed in to change notification settings - Fork 52
76 lines (70 loc) · 3.02 KB
/
cygwin.yml
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
name: cygwin
on:
push:
tags:
- 'v*'
jobs:
build:
if: github.repository_owner == 'openswoole'
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/openswoole/swoole-src/releases -O releases
$g=cat .\releases | ConvertFrom-Json
$version=$g[0].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/openswoole/swoole-src/archive/${{ steps.swoole_info.outputs.version }}.tar.gz -O openswoole.tar.gz
mkdir -p openswoole
tar -xf openswoole.tar.gz -C openswoole --strip-components=1
rm openswoole.tar.gz
cd openswoole
/bin/phpize
./configure --enable-openssl --with-openssl_dir=/usr --enable-http2 --enable-mysqlnd
make -j6
cp modules/openswoole.dll /usr/lib/php/20180731
echo 'extension=openswoole.dll' > /etc/php.d/zz_openswoole.ini
php -v
php -m
php --ri openswoole
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/openswoole/cygwin-build/archive/refs/heads/main.tar.gz -O cygwin.tar.gz
mkdir -p openswoole-cygwin
tar -xf cygwin.tar.gz -C openswoole-cygwin --strip-components=1
rm cygwin.tar.gz
cd openswoole-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: .\openswoole-cygwin\openswoole-cygwin-${{ steps.swoole_info.outputs.version }}.zip
asset_name: openswoole-cygwin-${{ steps.swoole_info.outputs.version }}.zip
asset_content_type: application/zip