add support for 'reuse' mode to allow act to be used for a fast local task runner

This commit is contained in:
Casey Lee
2019-01-17 00:45:37 -08:00
parent 317a305f51
commit 8793c8a6a4
11 changed files with 107 additions and 72 deletions

View File

@@ -12,20 +12,19 @@ endif
IS_SNAPSHOT = $(if $(findstring -, $(VERSION)),true,false)
TAG_VERSION = v$(VERSION)
ACT ?= go run main.go
default: check
deps:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $$(go env GOPATH)/bin v1.12.5
check:
golangci-lint run
go test -cover ./...
$(ACT) -ra check
build: deps check
@GO111MODULE=off go get github.com/goreleaser/goreleaser
build: check
$(eval export SNAPSHOT_VERSION=$(VERSION))
@goreleaser --snapshot --rm-dist
$(ACT) -ra build
release:
$(ACT) -ra release
install: build
@cp dist/$(shell go env GOOS)_$(shell go env GOARCH)/act /usr/local/bin/act
@@ -36,7 +35,6 @@ installer:
@GO111MODULE=off go get github.com/goreleaser/godownloader
godownloader -r nektos/act -o install.sh
promote:
@echo "VERSION:$(VERSION) IS_SNAPSHOT:$(IS_SNAPSHOT) LATEST_VERSION:$(LATEST_VERSION)"
ifeq (false,$(IS_SNAPSHOT))