-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
79 lines (64 loc) · 1.77 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
# https://taskfile.dev
# https://github.com/mdouchement/checksum
version: '3'
vars:
VERSION: 0.4.0
REVISION: { sh: git rev-parse HEAD }
env:
GO111MODULE: on
CGO_ENABLED: 0
tasks:
clean:
desc: Clean project
cmds:
- rm -rf ./dist
build-all:
desc: Build all binaries
cmds:
- task: clean
- mkdir -p ./dist
- task: build
vars:
BINARY_NAME: shigoto-linux-amd64
ENTRYPOINT: cmd/shigoto/*.go
TARGET_DIST: GOOS=linux GOARCH=amd64
- task: checksum
vars:
BINARY_NAME: shigoto-linux-amd64
- task: build
vars:
BINARY_NAME: shigoto-linux-arm64
ENTRYPOINT: cmd/shigoto/*.go
TARGET_DIST: GOOS=linux GOARCH=arm64
- task: checksum
vars:
BINARY_NAME: shigoto-linux-arm64
- task: build
vars:
BINARY_NAME: shigoto-darwin-amd64
ENTRYPOINT: cmd/shigoto/*.go
TARGET_DIST: GOOS=darwin GOARCH=amd64
- task: checksum
vars:
BINARY_NAME: shigoto-darwin-amd64
- task: build
vars:
BINARY_NAME: shigoto-windows-amd64.exe
ENTRYPOINT: cmd/shigoto/*.go
TARGET_DIST: GOOS=windows GOARCH=amd64
- task: checksum
vars:
BINARY_NAME: shigoto-windows-amd64.exe
build:
cmds:
- '{{.TARGET_DIST}} go build -ldflags "{{.LDFLAGS | splitList "\n" | join " "}}" -o ./dist/{{.BINARY_NAME}} {{.ENTRYPOINT}}'
vars:
LDFLAGS: |
-s
-w
-X main.version={{.VERSION}}
-X main.revision={{ printf "%.7s" .REVISION }}
-X main.date={{now | date "2006-01-02~15:04:05"}}
checksum:
cmds:
- cd dist && checksum --algs="sha256" --append-to checksum.txt {{.BINARY_NAME}}