updeep/Taskfile.yaml

65 lines
1.3 KiB
YAML

# https://taskfile.dev
version: "3"
vars:
VERSION:
sh: cat package.json | jq -r .version
PARENT_BRANCH: main
FILE_DELTA:
sh: git diff-ls {{.PARENT_BRANCH}}
FIX: false
tasks:
changelog:
sources: [./CHANGELOG.yml]
generates: [./CHANGELOG.md]
cmds:
- changelord print > CHANGELOG.md
test: vitest run
prettier:
cmd: prettier {{if .FIX }}--write{{end}} {{ .FILE_DELTA | catLines | default "." }}
checkout-clean:
cmds:
- sh: git is-clean
msg: stuff not commited
integrate:
deps: [prettier, test, build]
cmds:
- changeset status
- sh: git branch | grep '* {{.PARENT_BRANCH}}'
msg: not on target
- { task: checkout-clean }
- git checkout {{.PARENT_BRANCH}}
- git weld -
build:
sources: ["src/**"]
generates: ["esm/**"]
deps: [test]
cmds:
- rm -fr esm/
- tsc -p tsconfig.json
prepRelease:
deps: [test, changelog, build]
preconditions:
- sh: git branch | grep '* main'
msg: not on main
- sh: git is-clean
msg: stuff not commited
cmds:
- npm pack
publish:
deps: [prepRelease]
cmds:
- "git tag v{{.VERSION}}"
- npm publish --access public
- git push
- git push --tags