Skip to content

Commit 0a2c80c

Browse files
committed
Snapshot install.
1 parent f0870b3 commit 0a2c80c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ APP = path-helper
44
VERSION ?= $(shell cat ./version)
55
# build directory
66
BUILD_DIR ?= build
7+
# build flags
8+
BUILD_FLAGS ?= -v -a -ldflags=-s
9+
# gopath copy from environment
10+
GOPATH ?= ${GOPATH}
711

812
.PHONY: default bootstrap build clean test
913

@@ -13,10 +17,10 @@ bootstrap:
1317
GO111MODULE=on go mod vendor
1418

1519
build: clean
16-
go build -v -o $(BUILD_DIR)/$(APP) cmd/$(APP)/*
20+
CGO_ENABLED=0 go build $(BUILD_FLAGS) -o $(BUILD_DIR)/$(APP) cmd/$(APP)/*
1721

1822
install: build
19-
go install cmd/$(APP)/*
23+
CGO_ENABLED=0 go install $(BUILD_FLAGS) cmd/$(APP)/*
2024

2125
clean:
2226
rm -rf $(BUILD_DIR) > /dev/null
@@ -37,6 +41,12 @@ codecov:
3741
snapshot:
3842
goreleaser --rm-dist --snapshot
3943

44+
snapshot-local:
45+
goreleaser --rm-dist --snapshot --skip-publish --debug
46+
47+
snapshot-install: snapshot-local
48+
install -m 755 build/dist/darwin_darwin_amd64/$(APP) "$(GOPATH)/bin/$(APP)"
49+
4050
release:
4151
git tag $(VERSION)
4252
git push origin $(VERSION)

0 commit comments

Comments
 (0)