Skip to content

Commit

Permalink
updated the makefile to support creating releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Rowe committed Apr 2, 2018
1 parent b049c51 commit 4305035
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
BIN := databank-dbloader
MAIN := cmd/databank-dbloader/main.go
RCDB := baseball_databank_2017_a663145.sqlite3
TAG := 0.4.0
LINUX_TGZ := baseball-stats-db-$(TAG)-linux-amd64.tgz
MACOS_TGZ := baseball-stats-db-$(TAG)-macos-amd64.tgz

all: lint vet test build
all: lint vet test build linux

build: $(MAIN)
go build -o bin/$(BIN) $(MAIN)
Expand All @@ -13,4 +17,17 @@ test:
go test ./...

lint:
golint ./internal/... ./cmd/databank-dbloader/...
golint ./internal/... ./cmd/databank-dbloader/...

pkg-release-linux:
tar -zcvf $(LINUX_TGZ) $(RCDB) ./bin
sha256sum $(LINUX_TGZ) >./$(LINUX_TGZ).checksum

pkg-release-macos:
tar -zcvf $(MACOS_TGZ) $(RCDB) ./bin
shasum -a 256 $(MACOS_TGZ) >./$(MACOS_TGZ).checksum

release-linux: build pkg-release-linux

release-macos: build pkg-release-macos

0 comments on commit 4305035

Please sign in to comment.