updeep/Taskfile.yaml

65 lines
1.3 KiB
YAML
Raw Normal View History

2023-01-03 18:51:35 +00:00
# https://taskfile.dev
version: "3"
vars:
2023-01-11 18:31:55 +00:00
VERSION:
sh: cat package.json | jq -r .version
2023-04-10 14:27:26 +00:00
PARENT_BRANCH: main
FILE_DELTA:
sh: git diff-ls {{.PARENT_BRANCH}}
FIX: false
2023-01-03 18:51:35 +00:00
tasks:
2023-01-11 18:01:28 +00:00
changelog:
sources: [./CHANGELOG.yml]
generates: [./CHANGELOG.md]
cmds:
- changelord print > CHANGELOG.md
2023-03-22 21:12:47 +00:00
2023-01-03 19:31:53 +00:00
test: vitest run
2023-01-11 18:17:50 +00:00
2023-04-10 14:27:26 +00:00
prettier:
2023-04-10 14:38:48 +00:00
cmd: prettier {{if .FIX }}--write{{end}} {{ .FILE_DELTA | catLines | default "." }}
2023-04-10 14:27:26 +00:00
checkout-clean:
cmds:
- sh: git is-clean
msg: stuff not commited
integrate:
deps: [prettier, test, build]
cmds:
- echo {{ .FILE_DELTA | catLines }} | grep CHANGELOG.yml
- sh: git branch | grep '* {{.PARENT_BRANCH}}'
msg: not on target
- { task: checkout-clean }
- git checkout {{.PARENT_BRANCH}}
- git weld -
2023-01-03 18:51:35 +00:00
build:
2023-01-11 18:17:50 +00:00
sources: ["src/**"]
generates: ["esm/**"]
2023-01-03 19:31:53 +00:00
deps: [test]
2023-01-03 18:51:35 +00:00
cmds:
2023-01-03 19:31:53 +00:00
- rm -fr esm/
2023-01-03 18:51:35 +00:00
- tsc -p tsconfig.json
2023-01-11 18:17:50 +00:00
prepRelease:
2023-04-10 14:38:48 +00:00
deps: [test, changelog, build]
2023-01-11 18:17:50 +00:00
preconditions:
- sh: git branch | grep '* main'
msg: not on main
- sh: git is-clean
msg: stuff not commited
cmds:
- npm pack
2023-01-11 18:31:55 +00:00
publish:
deps: [prepRelease]
cmds:
- "git tag v{{.VERSION}}"
- npm publish --access public
- git push
- git push --tags