-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
151 lines (132 loc) · 3.98 KB
/
Copy pathTaskfile.yml
File metadata and controls
151 lines (132 loc) · 3.98 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: "3"
# ============================================================================
# kreuzberg-cloud-sdk — Root Taskfile
# ============================================================================
# Multi-language client SDK monorepo. Per-language tasks live under
# tasks/{python,typescript,go,dart,spec}.yml and are namespaced (python:test, etc.).
# ============================================================================
includes:
python:
taskfile: ./tasks/python.yml
typescript:
taskfile: ./tasks/typescript.yml
aliases: [ts]
go:
taskfile: ./tasks/go.yml
dart:
taskfile: ./tasks/dart.yml
spec:
taskfile: ./tasks/spec.yml
version:
taskfile: ./tasks/version.yml
tasks:
default:
desc: "List available tasks"
cmds:
- task --list
setup:
desc: "Install all language toolchains"
cmds:
- uv sync
- pnpm install
- cd packages/go/v1 && go mod download
- cd packages/dart && dart pub get
generate:
desc: "Regenerate all language clients from spec/openapi.yaml"
cmds:
- task: python:generate
- task: typescript:generate
- task: go:generate
- task: dart:generate
build:
desc: "Build distributable artifacts for all languages"
cmds:
- task: python:build
- task: typescript:build
- task: go:build
- task: dart:build
test:
desc: "Run all language test suites"
cmds:
- task: python:test
- task: typescript:test
- task: go:test
- task: dart:test
lint:
desc: "Lint all code via poly"
cmds:
- poly lint .
lint:check:
desc: "Lint all code via poly (check only)"
cmds:
- poly lint .
format:
desc: "Format all code via poly"
cmds:
- poly fmt --fix .
format:check:
desc: "Check formatting via poly (no writes)"
cmds:
- poly fmt --check .
fmt:
desc: "Alias for format"
cmds:
- task: format
validate:
desc: "Run lint + tests for all languages (CI parity)"
cmds:
- task: lint
- task: test
release:check:
desc: "Pre-flight: validate version semver, lint, test, build"
cmds:
- |
version=$(cat VERSION)
python3 -c "import re,sys;sys.exit(0 if re.match(r'^\d+\.\d+\.\d+([-+][\w.+-]+)?$','$version') else 1)" || { echo "VERSION '$version' is not valid semver" >&2; exit 1; }
echo "version: $version"
- task: lint
- task: test
- task: build
- echo "ready to tag v$(cat VERSION)"
release:tag:
desc: "Create and push the unified release tag (vX.Y.Z) — refuses if working tree dirty"
cmds:
- |
if [ -n "$(git status --porcelain)" ]; then
echo "working tree is dirty — commit or stash before tagging" >&2
exit 1
fi
version=$(cat VERSION)
tag="v$version"
if git rev-parse "$tag" >/dev/null 2>&1; then
echo "tag $tag already exists locally" >&2
exit 1
fi
git tag -a "$tag" -m "Release $tag"
echo "created tag $tag — push with: git push origin $tag"
clean:
desc: "Remove generated clients and build artifacts"
cmds:
- rm -rf packages/python/src/kreuzberg_cloud/_generated
- rm -rf packages/typescript/src/_generated
- rm -f packages/go/v1/generated.go
- rm -rf packages/dart/lib/src/_generated
- rm -rf packages/dart/.dart_tool packages/dart/build
- rm -rf packages/python/dist packages/typescript/dist
- rm -rf .pytest_cache .mypy_cache .ruff_cache htmlcov coverage
versions:sync:
desc: "Propagate root VERSION to all language package manifests"
cmds:
- task: version:sync
update:
desc: "Alias for upgrade"
cmds:
- task: upgrade
upgrade:
desc: "Update dependencies and tool pins"
cmds:
- uv sync --upgrade
- pnpm update -r
- cd packages/go/v1 && go get -u ./... && go mod tidy
- cd packages/dart && dart pub upgrade
- uvx --from gh-actions-updater gau --update .