Update php-ext github workflow

pull/10830/head
Sandy Zhang 2 years ago
parent 74b3c198b8
commit 9595e3e5fe
  1. 19
      .github/workflows/php-ext.yml
  2. 2
      php/BUILD.bazel
  3. 2
      php/ext/google/protobuf/BUILD.bazel

@ -17,7 +17,7 @@ jobs:
steps:
- name: Install bazel
run: |
sudo apt update && sudo apt install bazel
apt-get install bazel
- name: Install git
run: |
apt-get update -q
@ -26,24 +26,15 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare source code
run: |
rm -rf "$GITHUB_WORKSPACE/php/ext/google/protobuf/third_party"
cp -r "$GITHUB_WORKSPACE/third_party" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
cp "$GITHUB_WORKSPACE/LICENSE" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
- name: Generate package.xml
run: |
bazel build $GITHUB_WORKSPACE/php/ext/google/protobuf:generate_package_xml
cp $GITHUB_WORKSPACE/bazel-bin/php/ext/google/protobuf/package.xml $GITHUB_WORKSPACE/php/ext/google/protobuf/package.xml
- name: Create package
run: |
cd /tmp
rm -rf protobuf-*.tgz
pecl package "$GITHUB_WORKSPACE/php/ext/google/protobuf/package.xml"
rm -rf bazel-bin/php/protobuf-*.tgz
cd $GITHUB_WORKSPACE
bazel build php:release
- name: Compile extension
run: |
cd /tmp
MAKE="make -j$(nproc)" pecl install protobuf-*.tgz
MAKE="make -j$(nproc)" pecl install bazel-bin/php/protobuf-*.tgz
- name: Enable extension
run: docker-php-ext-enable protobuf
- name: Inspect extension

@ -147,5 +147,5 @@ pkg_tar(
"//php/ext/google/protobuf:release_files",
"//php/ext/google/protobuf:generate_package_xml",
],
out = "protobuf-%s" % PROTOBUF_PHP_VERSION,
out = "protobuf-%s.tgz" % PROTOBUF_PHP_VERSION,
)

@ -48,7 +48,7 @@ pkg_tar(
srcs = [
":release_files",
],
out = "release_without_package",
out = "release_without_package.tgz",
)
# Generate PECL package.xml

Loading…
Cancel
Save