generated from permafrost-dev/go-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
55 lines (46 loc) · 1.21 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
# This file can be run with the `task` utility: https://taskfile.dev/
version: '3'
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h
VERSION:
sh: go run tools/build-version.go
tasks:
mod:
desc: Downloads and tidy Go modules
cmds:
- go mod download
- go mod tidy
build:
cmds:
- task: build-laravel-make
clean:
desc: Cleans up build artifacts
cmds:
- rm -f ./dist/laravel-make
status:
- test -f ./dist/laravel-make
lint:
cmds:
- task: lint-laravel-make
update-version-file:
cmds:
- printf "package main\n\nvar Version = \"{{.VERSION}}\"" > ./cmd/laravel-make/version.go
status:
- test -f ./cmd/laravel-make/version.go
- grep -q "\"{{.VERSION}}\"" ./cmd/laravel-make/version.go
lint-laravel-make:
desc: Runs golangci-lint
cmds:
- golangci-lint run ./cmd/**
build-laravel-make:
desc: Builds laravel-make binary
deps:
- task: update-version-file
sources:
- './cmd/laravel-make/**/*.go'
generates:
- ./dist/laravel-make
cmds:
- mkdir -p ./dist
- go build -trimpath -ldflags="-s -w -X main.Version={{.VERSION}}-{{.GIT_COMMIT}}" -o dist ./cmd/laravel-make