Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
67 lines (57 loc) · 1.61 KB
/
Copy pathTaskfile.yml
File metadata and controls
67 lines (57 loc) · 1.61 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
# https://taskfile.dev
version: '3'
vars:
curr_version:
sh: uv version --short
tasks:
build:
cmds:
- task: check_existing
ignore_error: true
- task: check_remote
- uv build -o dist/{{.curr_version}}
upload:
cmds:
- uv publish dist/{{.curr_version}}/*
upload-test:
cmds:
- uv publish --index testpypi dist/{{.curr_version}}/*
check_remote:
desc: Fail if the version already exists on TestPyPI
cmds:
- |
if curl -sf https://test.pypi.org/pypi/plotlyshare/json | jq -e '.releases | has("{{.curr_version}}")' > /dev/null; then
echo "Version {{.curr_version}} already exists on TestPyPI, bump the version in pyproject.toml"
exit 1
else
echo "Version {{.curr_version}} is free on TestPyPI"
fi
check_existing:
cmds:
- defer:
task: _check_existing
vars:
version_exists: "{{if eq .EXIT_CODE 0}}true{{else}}false{{end}}"
- defer: echo {{.EXIT_CODE}}
- cmd: test -d dist/{{.curr_version}}
_check_existing:
cmds:
- echo {{.version_exists}}
- task: _check_existing_false
vars:
version_exists:
ref: .version_exists
- task: _check_existing_true
vars:
version_exists:
ref: .version_exists
_check_existing_true:
status:
- test "{{.version_exists}}" != "true"
cmds:
- echo "dist/{{.curr_version}} already exists, forgot to increase in pyproject.toml?"
_check_existing_false:
status:
- test "{{.version_exists}}" != "false"
cmds:
- echo hell yea