-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
15 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,22 +1,36 @@ | ||
SOURCE = $(wildcard *.go) | ||
TAG ?= $(shell git describe --tags) | ||
GOBUILD = go build -ldflags '-w' | ||
|
||
ALL = $(foreach suffix,win.exe linux osx,\ | ||
build/webhooker-$(suffix)) | ||
|
||
all: $(ALL) | ||
|
||
clean: | ||
rm -f $(ALL) | ||
|
||
test: | ||
go test | ||
cram tests/cram.t | ||
|
||
win.exe = windows | ||
osx = darwin | ||
build/webhooker-%: $(SOURCE) | ||
@mkdir -p $(@D) | ||
CGO_ENABLED=0 GOOS=$(firstword $($*) $*) GOARCH=amd64 go build -o $@ | ||
|
||
upload: $(ALL) | ||
ifndef UPLOAD_PATH | ||
@echo "Define UPLOAD_PATH to determine where files should be uploaded" | ||
release: $(ALL) | ||
ifndef desc | ||
@echo "Run it as 'make release desc=tralala'" | ||
else | ||
rsync -l -P $(ALL) $(UPLOAD_PATH) | ||
github-release release -u piranha -r webhooker -t "$(TAG)" -n "$(TAG)" --description "$(desc)" | ||
@for x in $(ALL); do \ | ||
echo "Uploading $$x" && \ | ||
github-release upload -u piranha \ | ||
-r webhooker \ | ||
-t $(TAG) \ | ||
-f "$$x" \ | ||
-n "$$(basename $$x)"; \ | ||
done | ||
endif | ||
|
||
test: | ||
go test | ||
cram tests/cram.t |
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
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