-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.5 KB
/
generate-examples.yml
File metadata and controls
59 lines (50 loc) · 1.5 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
name: Generate Examples
on:
workflow_dispatch:
release:
types: [published]
push:
branches: [master]
paths:
- 'src/**'
- 'Cargo.toml'
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Build dirpack
run: cargo build --release
- name: Generate examples
run: |
mkdir -p examples
# Generate at different token budgets
for tokens in 1000 2000 5000; do
./target/release/dirpack pack . \
-t $tokens \
-o examples/dirpack-${tokens}tok.txt \
--title "dirpack repo (${tokens} tokens)" \
--root-label "." \
-e "examples/*" \
-e "target/*"
done
# Also generate JSON format for 2k
./target/release/dirpack pack . \
-t 2000 \
-f json \
-o examples/dirpack-2000tok.json \
--title "dirpack repo (2000 tokens, JSON)" \
--root-label "." \
-e "examples/*" \
-e "target/*"
- name: Commit examples
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add examples/
git diff --staged --quiet || git commit -m "chore: regenerate examples [skip ci]"
git push