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

Commit

Permalink
Add make target for building a release (#27)
Browse files Browse the repository at this point in the history
* Add make target for building a release

* Update Makefile
  • Loading branch information
glyn committed Sep 10, 2019
1 parent 936ace9 commit a1706c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -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
@@ -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

0 comments on commit a1706c2

Please sign in to comment.