-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
214 lines (174 loc) · 4.34 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
version: '3'
# See guidelines: https://github.com/dxw/scripts-to-rule-them-all
# Vars: Example
# GIT_TAG:
# sh: git describe --tags 2>/dev/null || echo devel
# GIT_BRANCH:
# sh: git rev-parse --abbrev-ref HEAD
# PRJ_VERSION:
# sh: poetry version -s
includes:
dev:
taskfile: ./scripts/Taskfile.yml
dir: .
optional: true
doc:
taskfile: ./docs/Taskfile.yml
dir: ./docs
optional: true
docker:
taskfile: ./docker/Taskfile.yml
optional: true
tasks:
# Generic helpers
# -----------------
default:
desc: Show all commands
cmds:
- task --list-all
# Project helpers
# -----------------
bootstrap:
desc: Bootstrap environment
sources:
- poetry.lock
cmds:
- poetry --version 2>&/dev/null || pip install poetry
- poetry config --list
- poetry install -vv --no-interaction --no-root
setup:
desc: Setup project
deps:
- bootstrap
sources:
- myprj/*
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
# Used by semantic-release during publish process, as pre-commit command
#sources:
# - pyproject.toml
cmds:
- task: clean
- poetry build
- cp CHANGELOG.md dist/CHANGELOG.md
- cp VERSION_NOTES.md dist/RELEASE.md
clean:
desc: Clean generated packages
status:
- test ! -d dist/
cmds:
- rm -rf dist/ && mkdir -p dist
# Release workflow
# -----------------
release_changelog:
desc: "Used by semantic-release during publish process, as pre-commit command"
cmds:
- poetry run semantic-release changelog --unreleased > VERSION_NOTES.md
release_status:
desc: Show release status
cmds:
- poetry run ./scripts/versions.sh
release_stable:
desc: Bump code stable version, generate changelog, create a tag
# Note having :
# GH_TOKEN set will create a release in github
# PYPI_TOKEN set will release a version on pypi
preconditions:
- sh: >
[[ "$(git rev-parse --abbrev-ref HEAD)" == main ]]
msg: You must checkout 'main' branch first
- sh: >
! git status -s | grep -E '^[AM]* '
msg: You must clean your working dir first
cmds:
- SKIP=end-of-file-fixer poetry run semantic-release -D tag_commit=true publish
- task: publish_gh
- task: publish_pypi
- task: doc:publish_gh
release_beta:
aliases:
- release
desc: Bump code stable version, generate changelog, create a tag
preconditions:
- sh: '[[ "$(git rev-parse --abbrev-ref HEAD)" == develop ]]'
msg: You must checkout 'develop' branch first
- sh: ! git status -s | grep -E '^[AM]* '
msg: You must clean your working dir first
cmds:
- >
SKIP=end-of-file-fixer poetry run semantic-release
-D tag_commit=true
-D branch=develop
publish --prerelease
- task: publish_gh
- task: publish_pypi
- task: doc:publish_gh
# Publish workflow
# -----------------
publish_pypi:
desc: Publish python package on pypi.org
deps:
- build
cmds:
- poetry publish
publish_gh:
desc: Publish python packge on a github release
env:
INPUT_PRERELEASE: false
INPUT_ALLOW_OVERRIDE: true
vars:
INPUT_TOKEN:
sh: echo "$GH_TOKEN"
BODY_HEADER: |
## What's new in this version ?
This release has been published: $(date --utc)
## List of changes:
$(cat VERSION_NOTES.md)
deps:
- build
cmds:
- ls -ahl dist/
- INPUT_BODY="{{.BODY_HEADER}}" INPUT_TOKEN={{.INPUT_TOKEN}} bash scripts/publish_github.sh
#
# # Project Workflow
# # ---------------
# run_qa:
# desc: Run short test suites
# deps:
# - run_black
# - report_linting
#
# run_test:
# desc: Run full test suites
# deps:
# - run_black
# - run_test
# - report_coverage
# - report_linting
#
#
#
# # Top level Workflow
# # ---------------
#
# # serve_doc:
# # desc: Serve locally documentation site
# # deps:
# # - doc:serve_doc
#
# clean:
# desc: Clean all artifacts
# deps:
# - pkg_clean
# - docker_clean
#