-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathTaskfile.yml
More file actions
56 lines (48 loc) · 1.49 KB
/
Taskfile.yml
File metadata and controls
56 lines (48 loc) · 1.49 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
version: '3'
dotenv: ['.env', '{{.ENV}}/.env.', '{{.HOME}}/.env']
tasks:
docs:
cmds:
- poetry run mkdocs serve
test:
cmds:
- poetry run pytest
lint:
cmds:
- poetry run ruff check easyverein --fix
- poetry run ruff format easyverein
typecheck:
cmds:
- poetry run mypy easyverein
all:
cmds:
- task lint
- task typecheck
- task test
release:
desc: "Release a new version - updates version files and creates git commit"
vars:
VERSION: '{{.VERSION | default ""}}'
preconditions:
- sh: '[ -n "{{.VERSION}}" ]'
msg: "VERSION is required. Usage: task release VERSION=1.1.0"
- sh: 'echo "{{.VERSION}}" | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$"'
msg: "VERSION must be in format X.Y.Z (e.g. 1.1.0)"
cmds:
- echo "Releasing version {{.VERSION}}"
- |
# Update pyproject.toml version
sed -i '' 's/^version = ".*"/version = "{{.VERSION}}"/' pyproject.toml
- |
# Update __init__.py version
sed -i '' 's/^__version__ = ".*"/__version__ = "{{.VERSION}}"/' easyverein/__init__.py
- |
# Add files and create git commit
git add pyproject.toml easyverein/__init__.py
git commit -m "build: release version {{.VERSION}}"
- |
# Create git tag and push
git tag v{{.VERSION}}
git push origin main
git push origin v{{.VERSION}}
- echo "Successfully released version {{.VERSION}} and pushed to remote"