-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTaskfile.yml
48 lines (38 loc) · 915 Bytes
/
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
# SPDX-FileCopyrightText: 2024 Serpent OS Developers
# SPDX-License-Identifier: MPL-2.0
version: '3'
vars:
BINNAME: "libstone"
OUTPATH: "{{.ROOT_DIR}}/build/{{.BINNAME}}"
tasks:
default:
cmds:
- task: build
generate:
cmds:
- go generate ./...
build:
cmds:
- go build -o {{.OUTPATH}} -ldflags "-X github.com/serpent-os/libstone-go/internal/cli/cmd.Version={{.VERSION}}" internal/cli/main.go
vars:
VERSION:
sh: git describe --tags || git rev-parse HEAD
check:
cmds:
- go test ./...
install:
cmds:
- install -Dm00755 {{.OUTPATH}} -t {{.DESTDIR}}/{{.bindir}}
vars:
DESTDIR: /
prefix: /usr/local
bindir: "{{.prefix}}/bin"
clean:
cmds:
- rm -rf {{.OUTPATH}}
fmt:
cmds:
- gofmt -s -w .
check_formatting:
cmds:
- test -z $(gofmt -l -s .) && exit 0 || gofmt -d -s .; exit 1