-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
48 lines (41 loc) · 1.55 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
version: '3'
vars:
BASE_DIR:
sh: dirname $(pwd)
PROJECT_NAME:
sh: pwd|sed "s#{{.BASE_DIR}}/##g"
GOOS: ''
GOARCH: ''
tasks:
default:
cmds:
- task: deps
- task: build:binary
silent: true
deps:
desc: Install all dependencies (except dredd requirements)
cmds:
- task: deps:be
- task: deps:tools
deps:be:
desc: application dependencies
cmds:
- go mod tidy
- zip -r benchmark.zip benchmark/
deps:tools:
desc: Installs tools needed for building
vars:
GORELEASER_VERSION: "1.19.2"
cmds:
- '{{ if ne OS "windows" }} sh -c "curl -L https://github.com/goreleaser/goreleaser/releases/download/v{{ .GORELEASER_VERSION }}/goreleaser_$(uname -s)_$(uname -m).tar.gz | tar -xz -C $(go env GOPATH)/bin goreleaser"{{ else }} {{ end }}'
- '{{ if ne OS "windows" }} chmod +x $(go env GOPATH)/bin/goreleaser{{ else }} {{ end }}'
- '{{ if eq OS "windows" }} echo "NOTICE: You must download goreleaser manually to build this application https://github.com/goreleaser/goreleaser/releases "{{ else }}:{{ end }}'
- '{{ if eq OS "windows" }} echo "NOTICE: You need to install golangci-lint manually to build this application https://github.com/golangci/golangci-lint#install"{{ else }}{{ end }}'
build:binary:
desc: Build a binary for the current architecture
platforms: [amd64]
cmds:
- env CGO_ENABLED=0 GOOS={{ .GOOS }} GOARCH={{ .GOARCH }} go build -o ./bin/{{.PROJECT_NAME}}{{ if eq OS "windows" }}.exe{{ end }}
release:prod:
cmds:
- goreleaser