-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
131 lines (110 loc) · 3.51 KB
/
Copy pathTaskfile.yaml
File metadata and controls
131 lines (110 loc) · 3.51 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
version: '3'
tasks:
setup:
desc: "Setup development environment"
silent: true
status:
- rustup target list --installed | grep -q x86_64-apple-darwin
- rustup target list --installed | grep -q aarch64-apple-darwin
cmds:
- rustup target add x86_64-apple-darwin
- rustup target add aarch64-apple-darwin
test:
desc: "Run all tests"
cmds:
- cargo clippy --all-targets --all-features -- -D warnings
- cargo test --all-features
test:simple:
desc: "Run simple unit tests"
cmds:
- cargo clippy --all-targets --all-features -- -D warnings
- cargo test -- --nocapture
test:prompts:
desc: "Run prompt tests"
cmds:
- cargo test --test prompt_live -- --ignored --nocapture
run:simple:
desc: "Run commitbot in simple mode (no model, info verbosity) using cargo run"
cmds:
- cargo run -- -v
run:ask:
desc: "Run commitbot in interactive ask mode (no model, debug)"
cmds:
- cargo run -- --ask
run:ask:real:
desc: "Run commitbot in interactive ask mode using real model"
env:
OPENAI_API_KEY: '{{.OPENAI_API_KEY | default .DEFAULT_OPENAI_API_KEY}}'
cmds:
- |
if [ -z "$OPENAI_API_KEY" ]; then
echo "OPENAI_API_KEY is not set. Set it or pass via env when running task."
exit 1
fi
cargo run -- --ask
install:
desc: "Install commitbot binary locally via cargo install --path ."
cmds:
- brew uninstall mikegarde/tap/commitbot || true
- cargo install --path . --force
install:brew:
desc: "Install commitbot via Homebrew (macOS)"
cmds:
- cargo uninstall commitbot || true
- brew uninstall mikegarde/tap/commitbot || true
- brew install mikegarde/tap/commitbot
build:
desc: "Build debug binary for the host"
silent: true
cmds:
- cargo build 2>$1
- du -h target/debug/commitbot
build:release:
desc: "Build optimized release binary for the host"
silent: true
cmds:
- cargo build --release
- du -h target/release/commitbot
build:release:*:
desc: "Build release binaries for all targets and package into dist/"
vars:
VERSION: '{{index .MATCH 0}}'
silent: true
cmds:
- mkdir -p dist
- rm -f dist/commitbot-*.tar.gz
- |
set -euo pipefail
echo "Building Mac release binaries..."
cargo build --release --target aarch64-apple-darwin
cargo build --release --target x86_64-apple-darwin
du -h target/aarch64-apple-darwin/release/commitbot
du -h target/x86_64-apple-darwin/release/commitbot
echo "Packaging into dist with version {{.VERSION}}..."
tar -C target/aarch64-apple-darwin/release \
-czf dist/commitbot-{{.VERSION}}-apple-darwin-aarch64.tar.gz \
commitbot
tar -C target/x86_64-apple-darwin/release \
-czf dist/commitbot-{{.VERSION}}-apple-darwin-x86_64.tar.gz \
commitbot
echo "Artifacts created:"
ls -lh dist
release:*:
desc: "Create a release by building and publishing to crates.io (requires VERSION arg)"
vars:
VERSION: '{{index .MATCH 0}}'
interactive: true
cmds:
- task: test:simple
- sh devops/release.sh {{.VERSION}}
- task: publish:dry
- task: publish
- task: install
publish:dry:
desc: "Dry-run crates.io publish to verify packaging"
cmds:
- cargo publish --dry-run
publish:
desc: "Publish crate to crates.io"
cmds:
- cargo publish