Skip to content

Commit bd7fe9d

Browse files
committed
use remote php lib and add publish on tag
1 parent 3820088 commit bd7fe9d

File tree

16 files changed

+72
-1432
lines changed

16 files changed

+72
-1432
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish PHP SDK
2+
3+
on:
4+
push:
5+
tags:
6+
- "php-sdk-v*"
7+
8+
jobs:
9+
split-and-publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0 # Need full history for subtree split
16+
17+
- name: Split subtree
18+
run: |
19+
git subtree split --prefix=packages/php -b php-sdk-split
20+
21+
- name: Setup SSH for deploy key
22+
uses: webfactory/[email protected]
23+
with:
24+
ssh-private-key: |
25+
${{ secrets.PHP_SDK_DEPLOY_KEY }}
26+
27+
- name: Add GitHub to known_hosts
28+
run: |
29+
mkdir -p ~/.ssh
30+
ssh-keyscan github.com >> ~/.ssh/known_hosts
31+
32+
- name: Push to PHP SDK repository
33+
env:
34+
DEPLOY_KEY: ${{ secrets.PHP_SDK_DEPLOY_KEY }}
35+
run: |
36+
# Configure git
37+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
38+
git config --global user.name "github-actions[bot]"
39+
40+
# Extract version from tag (php-sdk-v1.0.0 -> v1.0.0)
41+
VERSION=${GITHUB_REF#refs/tags/php-sdk-}
42+
43+
# Push to separate repo
44+
git remote add php-sdk [email protected]:secmc/dragonfly-php-sdk.git
45+
git push php-sdk php-sdk-split:main --force
46+
git push php-sdk php-sdk-split:refs/tags/$VERSION
47+
48+
echo "✅ Published version $VERSION to dragonfly-php-sdk"

examples/plugins/php/composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"type": "project",
55
"require": {
66
"php": ">=8.1",
7+
"dragonfly/plugin-sdk": "^0.1",
78
"grpc/grpc": "1.74.0",
89
"google/protobuf": "^3.25"
910
},
@@ -12,8 +13,6 @@
1213
},
1314
"autoload": {
1415
"psr-4": {
15-
"Df\\": "../../../proto/generated/php/Df/",
16-
"Dragonfly\\PluginLib\\": "lib/",
1716
"ExamplePhp\\": "src/"
1817
}
1918
},

examples/plugins/php/lib/Actions/Actions.php

Lines changed: 0 additions & 253 deletions
This file was deleted.

0 commit comments

Comments
 (0)