mirror of
https://github.com/alexellis/arkade.git
synced 2022-05-07 18:22:49 +03:00
Fixes: #557 Closes: #628 - thanks to @yankeexe for his suggestions Runs every day at midnight, or upon new commits / PRs. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
40 lines
1.5 KiB
Makefile
40 lines
1.5 KiB
Makefile
Version := $(shell git describe --tags --dirty)
|
|
GitCommit := $(shell git rev-parse HEAD)
|
|
LDFLAGS := "-s -w -X github.com/alexellis/arkade/cmd.Version=$(Version) -X github.com/alexellis/arkade/cmd.GitCommit=$(GitCommit)"
|
|
PLATFORM := $(shell ./hack/platform-tag.sh)
|
|
SOURCE_DIRS = cmd pkg main.go
|
|
export GO111MODULE=on
|
|
|
|
.PHONY: all
|
|
all: gofmt test build dist hash
|
|
|
|
.PHONY: build
|
|
build:
|
|
go build
|
|
|
|
.PHONY: gofmt
|
|
gofmt:
|
|
@test -z $(shell gofmt -l -s $(SOURCE_DIRS) ./ | tee /dev/stderr) || (echo "[WARN] Fix formatting issues with 'make gofmt'" && exit 1)
|
|
|
|
.PHONY: test
|
|
test:
|
|
CGO_ENABLED=0 go test $(shell go list ./... | grep -v /vendor/|xargs echo) -cover
|
|
|
|
.PHONY: e2e
|
|
e2e:
|
|
CGO_ENABLED=0 go test github.com/alexellis/arkade/pkg/get -cover --tags e2e
|
|
|
|
.PHONY: dist
|
|
dist:
|
|
mkdir -p bin
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade
|
|
CGO_ENABLED=0 GOOS=darwin go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade-darwin
|
|
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -a -ldflags $(LDFLAGS) -installsuffix cgo -o bin/arkade-darwin-arm64
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade-armhf
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade-arm64
|
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags $(LDFLAGS) -a -installsuffix cgo -o bin/arkade.exe
|
|
|
|
.PHONY: hash
|
|
hash:
|
|
rm -rf bin/*.sha256 && ./hack/hashgen.sh
|