-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTaskfile.yml
174 lines (143 loc) · 3.1 KB
/
Taskfile.yml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
version: '3'
vars:
PRJ_DIR: paasify
includes:
dev:
taskfile: ./scripts/Taskfile.dev.yml
internal: true
dir: .
doc:
taskfile: ./docs/Taskfile.yml
# internal: true
dir: ./docs
optional: true
#docker:
# taskfile: ./docker/Taskfile.yml
# optional: true
extra:
taskfile: ./scripts/Taskfile.extra.yml
dir: .
optional: true
tasks:
# Generic helpers
# -----------------
default:
summary: Show all commands
cmds:
- task --list
# Project helpers
# -----------------
bootstrap:
desc: Bootstrap environment
vars:
venv:
sh: echo "${VIRTUAL_ENV:-.venv}/bin"
sources:
- poetry.lock
- pyproject.toml
generates:
- "{{ .venv }}}/bin/poetry"
cmds:
- eval "$(./scripts/platform.sh env)" && ./scripts/bootstrap_deps.sh
completion:
desc: Install completion for various tools
cmds:
- task: dev:install_comp
setup:
desc: Setup project
deps:
- bootstrap
sources:
- "{{.PRJ_DIR}}/*"
generates:
- "${VIRTUAL_ENV:-.venv}/bin/paasify"
cmds:
- poetry install -vv --no-interaction --only-root
update:
desc: Synchronize git
cmds:
- git fetch -a && git pull
- task: setup
# Build workflow
# -----------------
build:
desc: Create a python package
run: once
sources:
- pyproject.toml
cmds:
- task: clean
- poetry build
- cp CHANGELOG.md dist/CHANGELOG.md
clean:
desc: Clean generated packages
status:
- test ! -d dist/
cmds:
- rm -rf dist/ && mkdir -p dist
# Test Workflow
# ---------------
fix_qa:
desc: Fix quality issues
deps:
- dev:lint_black
- dev:lint_precommit
run_qa:
desc: Run short quality tests
deps:
- dev:report_lint
- dev:report_black
run_tests:
desc: Run full test suites
deps:
- dev:test
cmds:
- task: dev:report_cov
- task: dev:report_lint
# Versionning workflow
# -----------------
version:
desc: Show versions status
aliases:
- v
cmds:
- ./scripts/bump.sh {{.CLI_ARGS}}
bump:
desc: Bump version
cmds:
- ./scripts/bump.sh --exec {{.CLI_ARGS}}
changelog:
desc: Show release changelog
aliases:
- ch
cmds:
- cz changelog --dry-run --incremental
# Publish workflow
# -----------------
publish:
desc: Publish everything (GH, Pypi, Doc)
cmds:
- task: publish_gh
- task: publish_pypi
- task: doc:publish
publish_pypi:
summary: Publish python package on pypi.org
deps:
- build
preconditions:
- sh: '[[ -n "${POETRY_PYPI_TOKEN_PYPI-}" ]]'
msg: Please set POETRY_PYPI_TOKEN_PYPI environment variable
cmds:
- poetry publish --skip-existing
publish_gh:
summary: Publish python package on a github release
preconditions:
- sh: '[[ -n "${GH_TOKEN-}" ]]'
msg: Please set GH_TOKEN environment variable
vars:
INPUT_TOKEN:
sh: echo "$GH_TOKEN"
deps:
- build
cmds:
- ./scripts/publish_gh.sh