Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Add make target for building a release #27

Merged
merged 2 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
coverage.txt
/irel
/irel-darwin-amd64.tgz
/irel-linux-amd64.tgz
/irel-windows-amd64.zip
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.PHONY: test all check-counterfeiter gen-mocks
.PHONY: test all check-counterfeiter gen-mocks release

all: test

OUTPUT = ./irel
GO_SOURCES = $(shell find . -type f -name '*.go')

test:
Expand All @@ -17,5 +18,9 @@ gen-mocks: check-counterfeiter
counterfeiter pkg/registry LayoutPath

irel: $(GO_SOURCES)
GO111MODULE=on go build -o irel cmd/irel/main.go
GO111MODULE=on go build -o $(OUTPUT) cmd/irel/main.go

release: $(GO_SOURCES) test
GOOS=darwin GOARCH=amd64 go build -o $(OUTPUT) cmd/irel/main.go && tar -czf irel-darwin-amd64.tgz $(OUTPUT) && rm -f $(OUTPUT)
GOOS=linux GOARCH=amd64 go build -o $(OUTPUT) cmd/irel/main.go && tar -czf irel-linux-amd64.tgz $(OUTPUT) && rm -f $(OUTPUT)
GOOS=windows GOARCH=amd64 go build -o $(OUTPUT).exe cmd/irel/main.go && zip -mq irel-windows-amd64.zip $(OUTPUT).exe && rm -f $(OUTPUT).exe