-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTaskfile.yml
90 lines (79 loc) · 2.67 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
version: "3"
tasks:
default:
desc: Run the binary in "dev mode".
summary: |
Run the binary for development needs.
This command will build a development version of the tool before invoking it in
the current shell environment. Do note, this will run an unoptimised version of
the tool and is only useful during development.
cmd: go run main.go
install:
internal: true
desc: Install the dependencies for the project ONLY.
sources:
- go.mod
generates:
- go.sum
cmds:
- go mod download
- go mod tidy
setup:
desc: Setup the project for development.
summary: |
Setup the project for development.
This command will setup the project for local development. The command will
abstract away installation of the dependencies of the project and its
documentations as well.
cmds:
- task: install
- task: docs:setup
build:
desc: Build the binary for the current system architecture.
summary: |
Compile and build the binary.
This command will compile the source code and build the binary for the current
system architecture. Do note, it will not build the binary for the target
architecture unless specified.
vars:
VERSION:
sh: "git describe --tags --always --dirty"
GIT_VERSION:
sh: "git --version | awk '{print $3}'"
GIT_COMMIT:
sh: "git rev-parse --short HEAD"
BUILD_DATE:
sh: "date -u '+%Y-%m-%d'"
cmd: |
go build -ldflags "\
-X github.com/Weburz/crisp/internal/version.version={{.VERSION}} \
-X github.com/Weburz/crisp/internal/version.gitVersion={{.GIT_VERSION}} \
-X github.com/Weburz/crisp/internal/version.gitCommit={{.GIT_COMMIT}} \
-X github.com/Weburz/crisp/internal/version.buildDate={{.BUILD_DATE}}" \
-o ./bin/crisp
sources:
- "*.go"
generates:
- ./bin/crisp
docs:
desc: Run the dev server for the docs.
summary: |
Run the dev server for the docs.
This command will intelligently run the documentation's server from the
appropriate directory. Use this command during development to work on the docs or
use it for local reference.
dir: ./docs
cmd: pnpm dev
docs:setup:
desc: Install and setup the documentations.
summary: |
Setup the documentations.
This command will setup the documentations before development on the project can
be started. It will install all necessary dependencies and the prerequisites to
document the project.
dir: ./docs
cmd: pnpm install --frozen-lockfile
sources:
- package.json
generates:
- pnpm-lock.json