-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
80 lines (65 loc) · 1.7 KB
/
Taskfile.yaml
File metadata and controls
80 lines (65 loc) · 1.7 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
version: "3"
set: ["e", "u", "pipefail"]
interval: 2s
includes: {}
vars: {}
env: {}
tasks:
install:
cmds:
- rm -f ./npm-shrinkwrap.json
- npm install
- npm shrinkwrap
- task: install:hooks
- task: format
install:hooks:
cmds:
- npm exec lefthook uninstall
- npm exec lefthook install
format:
cmds:
- npm exec syncpack format
- npm pkg fix
build:
cmds:
- npm exec tsup
- npm exec tsc
run:
cmds:
- task: build
- ./dist/index.js {{.CLI_ARGS}}
publish: npm publish
publish:dry-run: npm publish --dry-run --no-git-checks
git:commit:pre:
silent: true
cmd: |
task format
task build
git add -A .
git:commit:post:
silent: true
cmd: |
echo "DateTime: $(date)"
MSG="$(git log -1 --pretty=format:%s)"
if ! echo "$MSG" | grep -E "^(major|minor|patch):"; then
exit 0
fi
if [[ "$MSG" == major:* ]]; then
npm version major --no-commit-hooks --no-git-tag-version
elif [[ "$MSG" == minor:* ]]; then
npm version minor --no-commit-hooks --no-git-tag-version
elif [[ "$MSG" == patch:* ]]; then
npm version patch --no-commit-hooks --no-git-tag-version
fi
git add -A .
TAGS="$(git tag --sort=version:refname)"
VERSION="v$(node -p "require('./package.json').version")"
MSG="(${VERSION}) ${MSG}"
git commit --amend -m "${MSG}"
if echo "$TAGS" | grep -q "${VERSION}"; then
echo "Tag: Already exists -> ${VERSION}"
else
echo "Tag: Create -> ${VERSION}"
git tag -a "${VERSION}" -m "${MSG}"
task publish
fi