-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
95 lines (83 loc) · 2.22 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
version: "3"
tasks:
release:
preconditions:
- sh: "[ '{{.VERSION}}' != '<no value>' ]"
msg: "Version required to release, example: $ task VERSION=v1.0.0 release"
deps: []
summary: |
Release Telego zip files
silent: true
cmds:
- echo releasing for {{.VERSION}}
- task: cleanup_build
- task: make_build_folders
- defer: { task: cleanup_build_sub }
- task: build
- task: copy_assets
- task: gen_zip_files
- task: end_of_release
end_of_release:
silent: true
cmds:
- echo release done, check build folder for zip files
build:
summary: |
Build telego for windows and linux platforms
silent: true
cmds:
- task: build_windows
- task: build_linux
build_windows:
silent: true
cmds:
- echo building for windows
- GOOS=windows CGO_ENABLED=0 go build -v
build_linux:
silent: true
cmds:
- echo building for linux
- GOOS=linux CGO_ENABLED=0 go build -v
cleanup_build:
silent: true
cmds:
- echo cleanup build folder
- rm -rf build
cleanup_build_sub:
silent: true
cmds:
- echo cleanup build sub folders
- rm -rf build/win
- rm -rf build/linux
make_build_folders:
silent: true
cmds:
- echo make build folders
- mkdir -p build/win
- mkdir -p build/linux
copy_assets:
silent: true
cmds:
- task: copy_windows_assets
- task: copy_linux_assets
copy_windows_assets:
silent: true
cmds:
- echo copying assets for windows
- mv telego.exe build/win/
- cp config.template.yaml build/win/config.template.yaml
- cp config.template.yaml build/win/config.yaml
copy_linux_assets:
silent: true
cmds:
- echo copying assets for linux
- mv telego build/linux/
- cp config.template.yaml build/linux/config.template.yaml
- cp config.template.yaml build/linux/config.yaml
gen_zip_files:
silent: true
cmds:
- echo generating zip for windows build
- 7z a build/telego-win-{{.VERSION}}.zip build/win/* > /dev/null
- echo generating zip for linux build
- 7z a build/telego-linux-{{.VERSION}}.zip build/linux/* > /dev/null