Repository navigation
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
109 lines (105 loc) · 3.7 KB
/
Copy pathTaskfile.yaml
File metadata and controls
109 lines (105 loc) · 3.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
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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
vars:
MODULES: [".", _examples, _integration]
MODRELEASE: github.com/lrstanley/x/cmd/modrelease@latest
method: timestamp
set: [errexit, nounset, pipefail]
tasks:
# go tasks, run across every module.
license:
desc: add license headers
cmds:
- curl -sL https://liam.sh/-/gh/g/license-header.sh | bash -s
tidy:
desc: run go mod tidy
cmds:
- for: { var: MODULES, as: MODULE }
cmd: cd {{.MODULE}} && go mod tidy
up:
desc: upgrade all go and bun dependencies
cmds:
- for: { var: MODULES, as: MODULE }
cmd: cd {{.MODULE}} && go get -u -t ./... && go mod tidy
- cd docs && bunx npm-check-updates -u && bun install
# CI runs this too, through lrstanley/.github's go test workflow.
test:
desc: run tests with the race detector, several times over
env:
GORACE: exitcode=1 halt_on_error=1
cmds:
- for: { var: MODULES, as: MODULE }
cmd: cd {{.MODULE}} && go test -v -race -timeout 3m -count 3 -cpu 1,4 {{default "./..." .CLI_ARGS}}
# run with --github-release and --highlights, so the GitHub release is created with notes. first run the plan, and
# read the changelog it prints. then write the highlights file, outside the repo so it isn't committed: a short
# summary of the notable changes. modrelease adds the changelog and the go get instructions itself, so don't repeat
# them. both the plan and --apply need a GH_TOKEN that can create releases. for example:
# GH_TOKEN=$(gh auth token) task release -- patch --alpha --github-release --highlights /tmp/highlights.md
# GH_TOKEN=$(gh auth token) task release -- patch --alpha --github-release --highlights /tmp/highlights.md --apply
release:
desc: release the module, printing the plan unless given --apply (task release -- <version> [--apply])
preconditions:
- sh: test -n {{shellQuote .CLI_ARGS}}
msg: "usage: task release -- <major|minor|patch|version> [--alpha|--beta|--rc] [--apply]"
cmds:
- go run {{.MODRELEASE}} {{.CLI_ARGS}}
# the documentation site.
docs:install:
desc: install the docs' dependencies
dir: docs
run: once
sources: [package.json, bun.lock]
status:
- test -d node_modules
cmds:
- bun install
docs:dev:
desc: run the docs' dev server
dir: docs
deps: [docs:install, docs:demos]
cmds:
- bun run dev
docs:build:
desc: build the docs
dir: docs
deps: [docs:install, docs:demos]
# checksum, so a build whose checks fail after writing dist isn't taken as done.
method: checksum
sources:
- "content/**/*"
- "src/**/*"
- "public/**/*"
- scripts/postbuild.ts
- "*.config.*"
- tsconfig.json
- package.json
- bun.lock
generates:
- dist/public/index.html
cmds:
- bun run build
docs:demos:
desc: record each example's tour to docs/public/demos/<example>.webp, for the docs pages (needs ffmpeg, --force to re-record)
dir: _examples
env:
STEEP_EXPORT_MODE: "on"
# checksum, so a run whose tests fail after writing some of the demos isn't taken as done.
method: checksum
sources:
# the module but its tests, the fonts it embeds, and the examples (tests included).
- "../*.go"
- "../{anim,canvas,fig,flex,fx,internal,on}/**/*.go"
- "../go.{mod,sum}"
- exclude: "../{*,{anim,canvas,fig,flex,fx,internal,on}/**/*}_test.go"
- "../fig/fonts/data/*"
- "**/*"
generates:
- ../docs/public/demos/*.webp
cmds:
- go test -count 1 ./...
docs:preview:
desc: preview the built docs
dir: docs
deps: [docs:build]
cmds:
- bun run preview