forked from grafana/tanka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 923 Bytes
/
Makefile
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
.PHONY: lint test static cross
VERSION := $(shell git describe --tags --dirty --always)
BIN_DIR := $(GOPATH)/bin
GOX := $(BIN_DIR)/gox
lint:
test -z $$(gofmt -s -l cmd/ pkg/)
go vet ./...
test:
go test ./...
# Compilation
dev:
go build -ldflags "-X main.Version=dev-${VERSION}" ./cmd/tk
LDFLAGS := '-s -w -extldflags "-static" -X main.Version=${VERSION}'
static:
CGO_ENABLED=0 GOOS=linux go build -ldflags=${LDFLAGS} ./cmd/tk
$(GOX):
go get -u github.com/mitchellh/gox
cross: $(GOX)
CGO_ENABLED=0 gox -output="dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags=${LDFLAGS} -arch="amd64 arm64 arm" -os="linux" -osarch="darwin/amd64" ./cmd/tk
# Docker container
container: static
docker build -t shorez/tanka .
# CI
drone:
jsonnet .drone/drone.jsonnet | jq .drone -r | yq -y . > .drone/drone.yml
changelog:
standard-version --skip.commit --skip.tag --preMajor
release:
standard-version --skip.changelog --preMajor