-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
79 lines (70 loc) · 1.63 KB
/
Taskfile.yaml
File metadata and controls
79 lines (70 loc) · 1.63 KB
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
version: '3'
vars:
SIGEX_VERSION:
sh: git describe --tags --abbrev=0
tasks:
build:
desc: build the go binary in dev mode and install
sources:
- ./**/*.go
generates:
- bin/sigex{{exeExt}}
cmds:
- echo "{{.SIGEX_VERSION}}"
- >
go build
-ldflags "-X github.com/signaldevs/sigex/cmd.version={{.SIGEX_VERSION}}"
-o bin/sigex
- >
go install
-ldflags "-X github.com/signaldevs/sigex/cmd.version={{.SIGEX_VERSION}}"
build-dist:
desc: build binaries for distribution
deps:
- clean
- build
cmds:
- task: build-os
vars:
GOOS: darwin
GOARCH: amd64
- task: build-os
vars:
GOOS: linux
GOARCH: amd64
- task: build-os
vars:
GOOS: windows
GOARCH: amd64
EXE: exe
build-os: >
GOOS={{.GOOS}}
GOARCH={{.GOARCH}}
go build
-ldflags "-X github.com/signaldevs/sigex/cmd.version={{.SIGEX_VERSION}}"
-o bin/sigex-v{{.SIGEX_VERSION}}-{{.GOOS}}-{{.GOARCH}}/sigex{{if .EXE}}.{{.EXE}}{{end}}
clean:
desc: clean the build directory
cmds:
- rm -rf bin
test:
desc: run unit tests
cmds:
- go test -cover -v ./...
example:
desc: run the example node app
cmds:
- >
sigex
-f examples/node/config/.dev.env
-f examples/node/.env
-e CLI_VAR=SomeCLIVar
node examples/node/app.js
uninstall:
desc: removes installed sigex package
vars:
SIGEX_INSTALL_PATH:
sh: which sigex
cmds:
- rm {{.SIGEX_INSTALL_PATH}}