From 5c0350bb762ebfaa2b994814a0e6355d57b64ed5 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Wed, 17 Apr 2024 11:19:19 +0200 Subject: [PATCH] Add php build --- .github/workflows/build-php.yml | 23 +++++++++++++++++------ build-php.sh | 5 +++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-php.yml b/.github/workflows/build-php.yml index eabb20d..a7dc0a5 100644 --- a/.github/workflows/build-php.yml +++ b/.github/workflows/build-php.yml @@ -24,10 +24,21 @@ jobs: - name: Build - run: echo TODO + run: bash build-php.sh - # - name: Upload PHP artifacts - # uses: actions/upload-artifact@v2 - # with: - # name: build-php - # path: build/php \ No newline at end of file + - 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 + \ No newline at end of file diff --git a/build-php.sh b/build-php.sh index c7a6c3f..d5d2bf5 100644 --- a/build-php.sh +++ b/build-php.sh @@ -2,10 +2,11 @@ set -e mkdir -p tmp mkdir -p build/php -pecl install grpc +pecl install grpc || true +pecl install protobuf || true protoc --proto_path=proto \ --php_out=build/php \ - --grpc_out=build/phpp \ + --grpc_out=build/php \ --plugin=protoc-gen-grpc=bins/opt/grpc_php_plugin \ --experimental_allow_proto3_optional \ proto/*.proto \ No newline at end of file