-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
140 lines (110 loc) · 2.6 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
version: "3"
vars:
GO: go
#output: #'prefixed'
# group: {begin: '::group::{{.TASK}}', end: '::endgroup::'}
tasks:
default: task -l
run-server:
desc: Run the Server
cmds:
- task: build_generic
vars:
GOOS: '{{OS}}'
GOARCH: '{{ARCH}}'
- ./bin/wakeonlan_{{OS}}_{{ARCH}}{{exeExt}}
deps:
- task: build-deps
build:
desc: Build for current OS or specifie os with "task build OS=your_os ARCH=your_arch"
cmds:
- task: build_generic
vars:
GOOS: '{{OS}}'
GOARCH: '{{ARCH}}'
deps:
- task: build-deps
list-dists:
desc: List all supported OS/ARCH combinations
cmds:
- go tool dist list
build-all:
desc: build for all major OS/ARCH combinations
cmds:
- task: build-deps
- task: build-all-concurrent
parallel: true
# Build binaries concurrently
build-all-concurrent:
desc: build for all major OS/ARCH combinations
deps:
- task: build_generic
vars:
GOOS: 'windows'
GOARCH: 'amd64'
- task: build_generic
vars:
GOOS: 'linux'
GOARCH: 'amd64'
- task: build_generic
vars:
GOOS: 'linux'
GOARCH: '386'
- task: build_generic
vars:
GOOS: 'linux'
GOARCH: 'arm64'
- task: build_generic
vars:
GOOS: 'linux'
GOARCH: 'arm'
build-deps:
desc: prepare the build environment
deps:
- embedFS
build_generic:
internal: true
label: 'build_{{.GOOS}}_{{.GOARCH}}'
run: when_changed
env:
GOOS: '{{.GOOS}}'
GOARCH: '{{.GOARCH}}'
generates:
- ./bin/wakeonlan_{{.GOOS}}_{{.GOARCH}}{{if eq .GOOS "windows"}}.exe{{end}}
sources:
- main.go
- pkg/*/*.go
- embedFS/*
cmds:
- go build -o bin/wakeonlan_{{.GOOS}}_{{.GOARCH}}{{if eq .GOOS "windows"}}.exe{{end}} cmd/server/main.go
- echo "Build for {{.GOOS}}/{{.GOARCH}} done"
preconditions:
- test -n '{{.GOOS}}'
- test -n '{{.GOARCH}}'
- test -f go.sum
- test -d embedFS
go-setup: #go.sum embedfs/
sources:
- go.mod
generates:
- go.sum
cmds:
# - go mod tidy
- go mod download
- go mod verify
embedFS:
deps:
- go-setup
sources:
- views/*
- assets/*
generates:
- embedFS/*
cmds:
- go get github.com/UnnoTed/fileb0x
- go generate
- go mod tidy
run-client:
desc: Run the Client
cmds:
- go run cmd/client/main.go