Skip to content

Commit 49b2276

Browse files
committed
init
1 parent ac98d59 commit 49b2276

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/build-grpc.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build gRPC PHP (PECL ARM64)
2+
3+
# Mengizinkan eksekusi manual
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
grpc_version:
8+
description: 'Versi gRPC di PECL (contoh: 1.80.0RC1)'
9+
required: true
10+
default: '1.80.0RC1'
11+
php_version:
12+
description: 'Versi PHP (contoh: 8.3)'
13+
required: true
14+
default: '8.3'
15+
16+
jobs:
17+
build-pecl-arm:
18+
# Menggunakan server fisik ARM64 dari GitHub (Super Cepat)
19+
runs-on: ubuntu-24.04-arm
20+
21+
steps:
22+
- name: 1. Install Dependensi Sistem
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y software-properties-common curl build-essential zlib1g-dev
26+
27+
- name: 2. Setup PPA Ondřej & Install PHP + PEAR (PECL)
28+
run: |
29+
sudo add-apt-repository -y ppa:ondrej/php
30+
sudo apt-get update
31+
# php-pear wajib diinstall agar perintah 'pecl' tersedia
32+
sudo apt-get install -y php${{ github.event.inputs.php_version }}-dev php${{ github.event.inputs.php_version }}-cli php-pear
33+
34+
- name: 3. Install gRPC via PECL (Proses Build)
35+
# PECL akan mengunduh source, menjalankan phpize, configure, dan make otomatis
36+
run: |
37+
sudo pecl install grpc-${{ github.event.inputs.grpc_version }}
38+
39+
- name: 4. Ambil File grpc.so
40+
run: |
41+
# Bertanya ke PHP di mana PECL meletakkan hasil build-nya
42+
EXT_DIR=$(php-config --extension-dir)
43+
echo "File grpc.so berhasil dibuat di: $EXT_DIR"
44+
45+
# Pindahkan file tersebut ke folder kerja utama agar bisa didownload
46+
cp $EXT_DIR/grpc.so ./grpc.so
47+
48+
- name: 5. Upload grpc.so sebagai Artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: grpc-arm64-pecl-php${{ github.event.inputs.php_version }}-v${{ github.event.inputs.grpc_version }}
52+
path: ./grpc.so

0 commit comments

Comments
 (0)