-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (32 loc) · 1.15 KB
/
Copy pathMakefile
File metadata and controls
43 lines (32 loc) · 1.15 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
BIN := bin/azctl
PKG := github.com/cyteger/azctl
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -s -w -X $(PKG)/internal/version.Version=$(VERSION)
.PHONY: build test test-race vet lint tidy clean install smoke release
build:
@mkdir -p bin
go build -ldflags "$(LDFLAGS)" -o $(BIN) ./cmd/azctl
test:
go test ./...
test-race:
go test -race ./...
vet:
go vet ./...
tidy:
go mod tidy
lint:
golangci-lint run
clean:
rm -rf bin coverage.txt
install: build
install -m 0755 $(BIN) $(HOME)/bin/azctl
smoke:
go test -tags=smoke -count=1 ./internal/ado/...
release:
@mkdir -p dist
GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o dist/azctl-darwin-arm64 ./cmd/azctl
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/azctl-darwin-amd64 ./cmd/azctl
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/azctl-linux-amd64 ./cmd/azctl
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o dist/azctl-linux-arm64 ./cmd/azctl
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o dist/azctl-windows-amd64.exe ./cmd/azctl
@cd dist && shasum -a 256 azctl-* > SHA256SUMS