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..03ab69d 100644 --- a/build-php.sh +++ b/build-php.sh @@ -2,10 +2,12 @@ set -e mkdir -p tmp mkdir -p build/php -pecl install grpc +pecl channel-update pecl.php.net || true +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