-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
67 lines (57 loc) · 1.64 KB
/
Taskfile.yaml
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
version: 3
vars:
APP_NAME: "{{ default `kubestatus2cloudwatch` .APP_NAME }}"
DIST_DIR: "{{ default `dist` .DIST_DIR }}"
OCI_REG: "{{ default `docker.io/trallnag` .OCI_REG }}"
tasks:
default:
- task: init
- task: fmt
- task: lint
- task: test
init:
desc: Init environment.
cmds:
- pre-commit install --install-hooks
- pre-commit install --install-hooks --hook-type commit-msg
update:
desc: Update environment.
cmds:
- pre-commit autoupdate
fmt:
desc: Run formatters.
cmds:
- gofmt -w .
- pre-commit run -a prettier
lint:
desc: Run linters.
cmds:
- golangci-lint run
test:
desc: Run tests.
cmds:
- go test -v -race -covermode=atomic -coverprofile=coverage.out
build-dist:
desc: Build distribution for multiple platforms.
cmds:
- >-
scripts/build-dist.py --name={{ .APP_NAME }} --dir={{ .DIST_DIR }} {{ if
.VERSION -}} --version={{ .VERSION }} {{ end }}
vars:
VERSION: "{{ default .VERSION nil }}"
build-buildx:
desc: Build and push Docker images.
cmds:
- >-
docker buildx build --push --platform linux/amd64,linux/arm64 --tag={{
.OCI_REG }}/{{ .APP_NAME }}:{{ .VERSION }} {{ if .LATEST -}} --tag={{
.OCI_REG }}/{{ .APP_NAME }}:latest {{ end -}} .
vars:
LATEST: "{{ default .LATEST nil }}"
VERSION: "{{ or .VERSION (fail `VERSION required`) }}"
extract-notes:
desc: Extract notes for latest release.
cmds:
- mkdir -p tmp
- scripts/extract-notes.py --input CHANGELOG.md --output tmp/release.md
- mdformat --wrap=10000 tmp/release.md