-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (57 loc) · 1.66 KB
/
build-php.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
name: Build PHP
on:
push:
release:
types: [published]
jobs:
build-and-publish:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Install dependencies
run: |
sudo pecl channel-update pecl.php.net
sudo pecl install protobuf
- name: Build grpc from source
run: |
git clone --recurse-submodules -b v1.62.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc
RDIR=$(pwd)
cd grpc
git submodule update --init
EXTRA_DEFINES=GRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK make
grpc_root="$(pwd)"
cd src/php/ext/grpc
phpize
GRPC_LIB_SUBDIR=libs/opt ./configure --enable-grpc="${grpc_root}"
make
sudo make install
cd $RDIR/grpc
mkdir -p cmake
cd cmake
cmake ..
make protoc grpc_php_plugin
- name: Build
run: |
export GRPC_EXT_PATH=$(pwd)/grpc/cmake/
export PROTOC=$(pwd)/grpc/cmake/third_party/protobuf/protoc
bash build-php.sh
- name: Upload PHP artifacts
uses: actions/upload-artifact@v2
with:
name: build-php
path: build/php
- name: Prepare asset for upload
run: |
tar -czf build/openagents_grpc_proto-PHP.tar.gz -C build/php/ .
- name: Upload release asset
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: build/openagents_grpc_proto-PHP.tar.gz