Skip to content

Commit

Permalink
Add dist
Browse files Browse the repository at this point in the history
  • Loading branch information
tomohiro committed Nov 22, 2019
1 parent 61b4542 commit c24b8b6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
mackerel-plugin-jitsi-videobridge
dist
38 changes: 30 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
# Project information
PACKAGE = $(shell basename ${PWD})
PACKAGE = $(shell basename ${PWD})
VERSION = $(shell git describe --abbrev=0 --tags)

# Build information
DIST_DIR = $(shell pwd)/dist
XC_OS = "linux darwin"
XC_ARCH = "386 amd64"

# Tasks
help:
@echo "Please type: make [target]"
@echo " test Run tests"
@echo " setup Setup development environment"
@echo " deps Install runtime dependencies"
@echo " updatedeps Update runtime dependencies"
@echo " test Run tests"
@echo " dist Ship packages to release"
@echo " clean Clean output binary"
@echo " help Show this help messages"

test: deps
@echo "===> Running tests..."
go test -v -cover ./lib
setup:
@echo "===> Setup development tools..."

# goxz - Just do cross building and archiving go tools conventionally
GO111MODULE=off go get -u github.com/Songmu/goxz/cmd/goxz

# ghr - Upload multiple artifacts to GitHub Release in parallel
GO111MODULE=off go get -u github.com/tcnksm/ghr

deps:
@echo "===> Installing runtime dependencies..."
Expand All @@ -22,8 +35,17 @@ updatedeps:
@echo "===> Updating runtime dependencies..."
go get -u

test: deps
@echo "===> Running tests..."
go test -v -cover ./lib

dist:
@echo "===> Build and shipping packages..."
goxz -d $(DIST_DIR) -os $(XC_OS) -arch $(XC_ARCH) -pv $(VERSION)

clean:
@echo "===> Clean output binary..."
rm ./$(PACKAGE)
@echo "===> Clean artifacts..."
go clean
rm -rf $(DIST_DIR)

.PHONY: help test deps updatedeps clean
.PHONY: help setup test deps updatedeps clean

0 comments on commit c24b8b6

Please sign in to comment.