-
Notifications
You must be signed in to change notification settings - Fork 23
73 lines (62 loc) · 2.4 KB
/
sync_native_bindings.yml
File metadata and controls
73 lines (62 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Sync Native Version & Bindings
on:
workflow_dispatch:
inputs:
native_tag:
description: 'llamadart-native release tag to sync (e.g., b8011 or latest)'
required: true
default: 'latest'
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- name: Cache Pub packages
uses: actions/cache@v5
with:
path: |
~/.pub-cache
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Install LLVM/Clang for ffigen
run: |
sudo apt-get update
sudo apt-get install -y llvm-dev libclang-dev clang rsync python3
- name: Install Dart/Flutter dependencies
run: flutter pub get
- name: Sync headers and regenerate bindings
id: sync_headers
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tool/native/sync_native_headers_and_bindings.sh --tag "${{ github.event.inputs.native_tag }}"
- name: Update native hook tag
run: |
TAG="${{ steps.sync_headers.outputs.resolved_tag }}"
sed -i "s/const _llamaCppTag = '.*';/const _llamaCppTag = '$TAG';/" hook/build.dart
- name: Create pull request
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(native): sync native release ${{ steps.sync_headers.outputs.resolved_tag }}"
title: "chore(native): sync native release ${{ steps.sync_headers.outputs.resolved_tag }}"
body: |
Automated sync from `leehack/llamadart-native` release `${{ steps.sync_headers.outputs.resolved_tag }}`.
Changes:
- Updates `hook/build.dart` native tag pin.
- Syncs headers from the matching `llamadart-native` release header bundle.
- Regenerates `lib/src/backends/llama_cpp/bindings.dart` via ffigen.
branch: "automation/native-sync-${{ steps.sync_headers.outputs.resolved_tag }}"
labels: automation/native-sync
add-paths: |
hook/build.dart
lib/src/backends/llama_cpp/bindings.dart
delete-branch: true