Skip to content

Commit 8c7a93c

Browse files
committed
WIP
1 parent 026fe62 commit 8c7a93c

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Drive Binding Generation
2+
on:
3+
workflow_run:
4+
workflows: ["Schema Update Check"]
5+
types: [completed]
6+
push:
7+
paths:
8+
- "bindings/templates/**"
9+
- "bindings/docker/**"
10+
workflow_dispatch:
11+
12+
jobs:
13+
call-gen:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
lang: [node, ruby, php, typescript]
18+
uses: ./.github/workflows/gen-binding.yml
19+
with:
20+
lang: ${{ matrix.lang }}

.github/workflows/gen-binding.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Generate & test binding
2+
on:
3+
workflow_call:
4+
inputs:
5+
lang:
6+
description: 'Language to generate binding for'
7+
required: true
8+
type: string
9+
10+
jobs:
11+
generate:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Download Native Binaries
22+
uses: actions/download-artifact@v4
23+
with:
24+
pattern: native-binaries-*
25+
path: artifacts/native_binaries/
26+
merge-multiple: true
27+
28+
- name: Generate models only
29+
uses: docker://ghcr.io/imageflow/bindings-${{ inputs.lang }}:latest
30+
with:
31+
args: |
32+
--schema-path imageflow_core/src/json/endpoints/openapi_schema_v1.json
33+
--output-path bindings/imageflow-${{ inputs.lang }}/
34+
--native-path artifacts/native_binaries/
35+
--global-property models
36+
37+
- name: Run AI Agent to update manual code (Placeholder)
38+
run: |
39+
echo "[Placeholder] AI agent is now analyzing the schema changes and updating the manual FFI and public API code for ${{ inputs.lang }}."
40+
echo "[Placeholder] In a real implementation, this step would invoke an AI service and apply its suggested changes."
41+
42+
- name: Run smoke test
43+
run: |
44+
chmod +x ./bindings/scripts/run_smoke_test.sh
45+
./bindings/scripts/run_smoke_test.sh ${{ inputs.lang }} local
46+
47+
- name: Create/Update PR
48+
if: success()
49+
uses: peter-evans/create-pull-request@v5
50+
with:
51+
token: ${{ secrets.GH_PAT }}
52+
branch: ci/${{ inputs.lang }}/regen-${{ github.run_number }}
53+
title: "feat(${{ inputs.lang }}): Auto-update binding from schema change"
54+
body: |
55+
This PR was auto-generated in response to a schema update.
56+
57+
It includes:
58+
1. Newly generated data models.
59+
2. AI-assisted updates to the manual FFI and public API code.
60+
61+
Generated from schema in commit: ${{ github.sha }}
62+
**This PR replaces any previous ${{ inputs.lang }} binding PRs**
63+
labels: automerge
64+
delete-branch: true

0 commit comments

Comments
 (0)