forked from charmbracelet/fantasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
45 lines (40 loc) · 1.18 KB
/
Taskfile.yaml
File metadata and controls
45 lines (40 loc) · 1.18 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
version: "3"
tasks:
fmt:
desc: Run gofumpt for all packages
cmds:
- gofumpt -w .
modernize:
desc: Run modernize for all packages
cmds:
- modernize -fix ./...
lint:
desc: Run base linters for all packages
cmds:
- golangci-lint run
lint:fix:
desc: Run base linters for all packages and applies fixes if possible
cmds:
- golangci-lint run --fix
test:
desc: Run tests for all packages
cmds:
- go test ./... -count=1 {{.CLI_ARGS}}
release:
desc: Create and push a new tag following semver
vars:
NEXT:
sh: svu next --always || go run github.com/caarlos0/svu/v3@latest next --always
prompt: "This will release {{.NEXT}}. Continue?"
preconditions:
- sh: '[ $(git symbolic-ref --short HEAD) = "main" ]'
msg: Not on main branch
- sh: "[ $(git status --porcelain=2 | wc -l) = 0 ]"
msg: "Git is dirty"
cmds:
- echo {{trimPrefix "v" .NEXT}} > version.txt
- git add version.txt
- git commit -m "{{.NEXT}}"
- git tag --annotate --sign -m "{{.NEXT}}" {{.NEXT}} {{.CLI_ARGS}}
- echo "Pushing {{.NEXT}}..."
- git push origin main --follow-tags