-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
66 lines (58 loc) · 1.27 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
version: '3'
# includes:
# checksum: ./Taskfile_checksum_{{OS}}.yml
tasks:
build:
cmds:
- >
go build -v -trimpath
--ldflags "-X main.version=$VERSION"
-o {{.BUILD_NAME}}
env:
VERSION: dev
OS: "{{OS}}"
ARCH: "{{ARCH}}"
CGO_ENABLED: 1
vars:
BUILD_NAME:
sh: task build:name
build:name:
cmds:
- task: "build:name:{{OS}}-{{ARCH}}"
build:name:darwin-amd64:
cmds:
- echo "2ami-$VERSION-darwin-amd64"
env:
VERSION: dev
build:name:linux-amd64:
cmds:
- echo "2ami-$VERSION-linux-amd64"
env:
VERSION: dev
build:name:windows-amd64:
cmds:
- echo "2ami-$VERSION-windows-amd64{{exeExt}}"
env:
VERSION: dev
checksum:upload:
cmds:
- gh release upload $VERSION ./checksum-{{.BUILD_NAME}}.txt
env:
VERSION: dev
vars:
BUILD_NAME:
sh: task build:name
preconditions:
- sh: "[ -n \"$GITHUB_TOKEN\" ]"
msg: "GITHUB_TOKEN must be set"
release:upload:
cmds:
- gh release upload $VERSION ./{{.BUILD_NAME}}
env:
VERSION: dev
vars:
BUILD_NAME:
sh: task build:name
preconditions:
- sh: "[ -n \"$GITHUB_TOKEN\" ]"
msg: "GITHUB_TOKEN must be set"