forked from go-task/task
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
122 lines (103 loc) · 2.86 KB
/
Taskfile.yml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
version: '3'
includes:
docs:
aliases: [d]
taskfile: ./docs
dir: ./docs
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h
GO_PACKAGES:
sh: go list ./...
env:
CGO_ENABLED: '0'
tasks:
default:
cmds:
- task: lint
- task: test
install:
desc: Installs Task
aliases: [i]
sources:
- './**/*.go'
cmds:
- go install -v -ldflags="-w -s -X main.version={{.GIT_COMMIT}}" ./cmd/task
mod:
desc: Downloads and tidy Go modules
cmds:
- go mod download
- go mod tidy
clean:
desc: Cleans temp files and folders
cmds:
- rm -rf dist/
- rm -rf tmp/
lint:
desc: Runs golangci-lint
aliases: [l]
sources:
- './**/*.go'
cmds:
- golangci-lint run
sleepit:build:
desc: Builds the sleepit test helper
sources:
- ./cmd/sleepit/**/*.go
generates:
- ./bin/sleepit
cmds:
- go build -o ./bin/sleepit{{exeExt}} ./cmd/sleepit
sleepit:run:
desc: Builds the sleepit test helper
deps: [sleepit:build]
cmds:
- ./bin/sleepit {{.CLI_ARGS}}
silent: true
test:
desc: Runs test suite
aliases: [t]
deps: [install]
cmds:
- go test {{catLines .GO_PACKAGES}}
test:signals:
desc: Runs test suite with signals tests included
deps: [install, sleepit:build]
cmds:
- go test {{catLines .GO_PACKAGES}} -tags signals
test-release:
desc: Tests release process without publishing
cmds:
- goreleaser --snapshot --rm-dist
docs:changelog:
desc: Copy CHANGELOG.md to the documentation website
vars:
FILE: docs/docs/changelog.md
cmds:
- rm {{.FILE}}
- 'echo "---" >> {{.FILE}}'
- 'echo "slug: /changelog/" >> {{.FILE}}'
- 'echo "sidebar_position: 6" >> {{.FILE}}'
- 'echo "---" >> {{.FILE}}'
- 'echo "" >> {{.FILE}}'
- 'cat CHANGELOG.md >> {{.FILE}}'
npm:publish:
desc: Publish release to npm
cmds:
- npm publish --access=public
packages:
cmds:
- echo '{{.GO_PACKAGES}}'
silent: true
upowr:install:
cmds:
- go install ./cmd/task
- GOOS=linux GOARCH=amd64 go install ./cmd/task
- test "$(uname)" != "Darwin" || cp ${GOBIN:-${GOPATH:-${HOME}/go}/bin}/linux_amd64/task ${GOBIN:-${GOPATH:-${HOME}/go}/bin}/linux_amd64/task.linux.amd64
upowr:build:
cmds:
- GOOS=darwin GOARCH=arm64 go build -o dist/task.darwin.arm64 ./cmd/task
- GOOS=darwin GOARCH=amd64 go build -o dist/task.darwin.amd64 ./cmd/task
- GOOS=linux GOARCH=arm64 go build -o dist/task.linux.aarch64 ./cmd/task
- GOOS=linux GOARCH=amd64 go build -o dist/task.linux.amd64 ./cmd/task
- find dist -mindepth 1 -maxdepth 1 -type f | grep -v manifest.json | xargs -n1 sha1sum | jq -Rc '.|split(" ") as $r|{}|.key=($r[2]|sub("^dist/"; ""))|.value=$r[0]' | jq -s '.|from_entries' > dist/manifest.json