Skip to content

Commit

Permalink
Working linux build again.
Browse files Browse the repository at this point in the history
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
yawn committed Sep 12, 2018
1 parent a2e1846 commit 13ebcc3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions Makefile
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.

0 comments on commit 13ebcc3

Please sign in to comment.