diff --git a/.travis.yml b/.travis.yml index 4ff513f..8d02f8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: go go: -- 1.9 +- tip script: - make lint - make test diff --git a/Gopkg.toml b/Gopkg.toml index 01bc257..932decd 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -37,6 +37,10 @@ branch = "master" name = "github.com/kballard/go-shellquote" +[[constraint]] + branch = "master" + name = "github.com/lestrrat-go/strftime" + [[constraint]] branch = "master" name = "golang.org/x/sync" diff --git a/Makefile b/Makefile index cbea8a1..27eb44d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ +VERSION = $(shell gobump show -r) CURRENT_REVISION = $(shell git rev-parse --short HEAD) -BUILD_LDFLAGS = "-X github.com/Songmu/horenso.revision=$(CURRENT_REVISION)" +BUILD_LDFLAGS = "-s -w -X github.com/Songmu/horenso.revision=$(CURRENT_REVISION)" ifdef update u=-u endif @@ -9,12 +10,12 @@ deps: dep ensure devel-deps: deps - go get ${u} golang.org/x/lint/golint - go get ${u} github.com/mattn/goveralls - go get ${u} github.com/motemen/gobump - go get ${u} github.com/laher/goxc - go get ${u} github.com/Songmu/ghch - go get ${u} github.com/tcnksm/ghr + go get ${u} golang.org/x/lint/golint \ + github.com/mattn/goveralls \ + github.com/motemen/gobump \ + github.com/Songmu/goxz/cmd/goxz \ + github.com/Songmu/ghch/cmd/ghch \ + github.com/tcnksm/ghr test: deps go test @@ -29,13 +30,17 @@ cover: devel-deps build: deps go build -ldflags=$(BUILD_LDFLAGS) ./cmd/horenso +bump: devel-deps + _tools/releng + crossbuild: devel-deps - goxc -pv=v$(shell gobump show -r) -build-ldflags=$(BUILD_LDFLAGS) \ - -os=linux,darwin,freebsd -arch=386,amd64 -d=./dist \ - -tasks=clean-destination,xc,archive,rmbin + goxz -pv=v$(VERSION) -build-ldflags=$(BUILD_LDFLAGS) \ + -os=linux,darwin,freebsd -arch=386,amd64 \ + -d=./dist/v$(VERSION) ./cmd/horenso -release: devel-deps - _tools/releng - _tools/upload_artifacts +upload: + ghr v$(VERSION) dist/v$(VERSION) + +release: bump crossbuild upload -.PHONY: deps devel-deps test lint cover build crossbuild release +.PHONY: deps devel-deps test lint cover build bump crossbuild upload release diff --git a/_tools/upload_artifacts b/_tools/upload_artifacts deleted file mode 100755 index 67e1bfa..0000000 --- a/_tools/upload_artifacts +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -e - -ver=v$(gobump show -r) -make crossbuild -ghr $ver dist/$ver