-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also dropped “parallel” and “gox” as build requirements. Added “docker” though. Temporarly disabled upx due to issues with 1.11 and Darwin.
- Loading branch information
Showing
2 changed files
with
17 additions
and
12 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,32 +1,37 @@ | ||
VERSION := "2.2.1" | ||
VERSION := "2.3.0RC1" | ||
|
||
BUILD := $(shell git rev-parse --short HEAD) | ||
FLAGS := "-s -w -X=main.build=$(BUILD) -X=main.time=`TZ=UTC date '+%FT%TZ'` -X=main.version=$(VERSION)" | ||
REPO := awsu | ||
TOKEN = $(shell cat .token) | ||
USER := kreuzwerker | ||
|
||
build: | ||
gox -parallel=8 -osarch="darwin/amd64 linux/amd64" -ldflags $(FLAGS) -output "build/awsu-{{.OS}}-{{.Arch}}" ./bin/ | ||
parallel upx --best --ultra-brute --quiet {} ::: build/awsu-*-* | ||
build/awsu-linux-amd64: | ||
@mkdir -p build | ||
nice docker container run -it --rm -e "GO111MODULE=on" \ | ||
-v $(PWD):/go/src/github.com/kreuzwerker/awsu \ | ||
golang:1.11-stretch bash -c \ | ||
"apt-get update -q && apt-get install -qqy libpcsclite-dev && cd /go/src/github.com/kreuzwerker/awsu && go mod download && go build -o $@ -ldflags $(FLAGS) awsu.go" | ||
|
||
build/awsu-darwin-amd64: | ||
@mkdir -p build | ||
GO111MODULES=on nice go build -o $@ -ldflags $(FLAGS) awsu.go | ||
|
||
build: build/awsu-darwin-amd64 build/awsu-linux-amd64 | ||
@echo build all | ||
|
||
clean: | ||
rm -rf build | ||
|
||
check: | ||
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),) | ||
$(error git state is not clean) | ||
endif | ||
|
||
release: check clean build | ||
release: clean build | ||
git tag $(VERSION) -f && git push --tags -f | ||
github-release release --user $(USER) --repo $(REPO) --tag $(VERSION) -s $(TOKEN) | ||
parallel github-release upload --user $(USER) --repo $(REPO) --tag $(VERSION) -s $(TOKEN) --name {/} --file {} ::: build/* | ||
find build/* -type f -print0 -execdir github-release upload --user $(USER) --repo $(REPO) --tag $(VERSION) -s $(TOKEN) --name {} --file build/{} \; | ||
|
||
retract: | ||
github-release delete --tag $(VERSION) -s $(TOKEN) | ||
|
||
test: | ||
go list ./... | grep -v exp | xargs go test -cover | ||
|
||
.PHONY: build clean check release retract test | ||
.PHONY: build clean release retract test |
File renamed without changes.