-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Makefile to help build releases
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
go-junit-report | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
VERSION=$(shell git describe --match="v*") | ||
REVISION=$(shell git rev-parse HEAD) | ||
TIMESTAMP=$(shell date +%FT%T) | ||
|
||
test: | ||
go test ./... | ||
|
||
build/go-junit-report build/go-junit-report.exe: clean | ||
go build --ldflags "-s -X main.Version=$(VERSION) -X main.Revision=$(REVISION) -X main.BuildTime=$(TIMESTAMP)" -o $@ | ||
|
||
build/go-junit-report-$(VERSION)-$(GOOS)-$(GOARCH).tar.gz: build/go-junit-report | ||
tar czf $@ -C build go-junit-report | ||
|
||
build/go-junit-report-$(VERSION)-windows-amd64.zip: build/go-junit-report.exe | ||
zip -j $@ build/go-junit-report.exe | ||
|
||
release: test | ||
$(MAKE) GOOS=linux GOARCH=amd64 build/go-junit-report-$(VERSION)-linux-amd64.tar.gz | ||
$(MAKE) GOOS=windows GOARCH=amd64 build/go-junit-report-$(VERSION)-windows-amd64.zip | ||
$(MAKE) GOOS=darwin GOARCH=amd64 build/go-junit-report-$(VERSION)-darwin-amd64.tar.gz | ||
|
||
clean: | ||
rm -f build/go-junit-report | ||
rm -f build/go-junit-report.exe | ||
|
||
.PHONY: build clean release test |