-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
72 lines (63 loc) · 1.7 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
68
69
70
71
72
version: 3
vars:
APP_NAME: "{{ default `token2go-server` .APP_NAME }}"
DIST_DIR: "{{ default `dist` .DIST_DIR }}"
OCI_REG: "{{ default `docker.io/trallnag` .OCI_REG }}"
tasks:
default:
- task: fmt
- task: lint
- task: test
fmt:
desc: Run formatters.
cmds:
- gofmt -w .
- pre-commit run -a mdformat
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`)}}"
update-swagger:
desc: Update vendored Swagger UI.
cmds:
- scripts/update-swagger.sh {{ .VERSION }}
status:
- test -f swagger-ui/version.txt
- "[[ $(cat swagger-ui/version.txt) == {{ .VERSION }} ]]"
vars:
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