-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
f2475c7
commit 8b19dbd
Showing
7 changed files
with
54 additions
and
2 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 |
---|---|---|
|
@@ -2,5 +2,8 @@ | |
.idea | ||
.gobuild | ||
./cache | ||
vendor/ | ||
samples/ | ||
release/ | ||
todo | ||
jbuilder |
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,37 @@ | ||
NAME=jbuilder | ||
VERSION=$(shell cat VERSION) | ||
BUILD=$(shell git rev-parse --short HEAD) | ||
EXT_LD_FLAGS="-Wl,--allow-multiple-definition" | ||
LD_FLAGS="-w -X main.version=$(VERSION) -X main.build=$(BUILD) -extldflags=$(EXT_LD_FLAGS)" | ||
|
||
clean: | ||
rm -rf _build/ release/ | ||
|
||
build: | ||
go mod download | ||
CGO_ENABLED=0 go build -tags release -ldflags $(LD_FLAGS) -o jbuilder | ||
|
||
build-dev: | ||
go build -ldflags "-w -X main.version=$(VERSION)-dev -X main.build=$(BUILD) -extldflags=$(EXT_LD_FLAGS)" | ||
|
||
build-all: | ||
mkdir -p _build | ||
GOOS=darwin GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o _build/jbuilder-$(VERSION)-darwin-amd64 | ||
GOOS=linux GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o _build/jbuilder-$(VERSION)-linux-amd64 | ||
GOOS=linux GOARCH=arm go build -tags release -ldflags $(LD_FLAGS) -o _build/jbuilder-$(VERSION)-linux-arm | ||
GOOS=linux GOARCH=arm64 go build -tags release -ldflags $(LD_FLAGS) -o _build/jbuilder-$(VERSION)-linux-arm64 | ||
GOOS=windows GOARCH=amd64 go build -tags release -ldflags $(LD_FLAGS) -o _build/jbuilder-$(VERSION)-windows-amd64 | ||
cd _build; sha256sum * > sha256sums.txt | ||
|
||
image: | ||
docker build -t jbuilder -f Dockerfile . | ||
|
||
release: | ||
mkdir release | ||
go get github.com/progrium/gh-release/... | ||
cp _build/* release | ||
cd release; sha256sum --quiet --check sha256sums.txt | ||
gh-release create gocruncher/$(NAME) $(VERSION) \ | ||
$(shell git rev-parse --abbrev-ref HEAD) $(VERSION) | ||
|
||
.PHONY: 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
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 @@ | ||
1.0.0 |
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