diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b420a41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.* +!.gitignore +!.travis.yml +dist/ diff --git a/.travis.yml b/.travis.yml index 3629ac4..5a64678 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: go +os: +- linux +- osx go: - tip script: diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b239c3e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## [v0.1.0](https://github.com/Songmu/timeout/compare/v0.0.1...v0.1.0) (2017-03-26) + +* [incompatible] Support Foreground option [#6](https://github.com/Songmu/timeout/pull/6) ([Songmu](https://github.com/Songmu)) +* [incompatible] killall child processes when sending SIGKILL on Unix systems [#5](https://github.com/Songmu/timeout/pull/5) ([Songmu](https://github.com/Songmu)) +* Call taskkill [#3](https://github.com/Songmu/timeout/pull/3) ([mattn](https://github.com/mattn)) +* update ci related files [#4](https://github.com/Songmu/timeout/pull/4) ([Songmu](https://github.com/Songmu)) + +## [v0.0.1](https://github.com/Songmu/timeout/compare/fca682e36f92...v0.0.1) (2015-04-23) + +* Fix document [#2](https://github.com/Songmu/timeout/pull/2) ([syohex](https://github.com/syohex)) +* Support windows [#1](https://github.com/Songmu/timeout/pull/1) ([mattn](https://github.com/mattn)) diff --git a/Makefile b/Makefile index 84cc5fc..34ecc72 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,43 @@ -test: deps - go test ./... +CURRENT_REVISION = $(shell git rev-parse --short HEAD) +BUILD_LDFLAGS = "-X github.com/Songmu/timeout.revision=$(CURRENT_REVISION)" +ifdef update + u=-u +endif deps: - go get -d -v -t ./... - go get github.com/golang/lint/golint - go get golang.org/x/tools/cmd/cover - go get github.com/mattn/goveralls + go get ${u} -d -v ./... + +test-deps: + go get ${u} -d -v -t ./... + +devel-deps: test-deps + go get ${u} github.com/golang/lint/golint + go get ${u} github.com/mattn/goveralls + go get ${u} github.com/motemen/gobump/cmd/gobump + go get ${u} github.com/Songmu/goxz/cmd/goxz + go get ${u} github.com/Songmu/ghch/cmd/ghch + go get ${u} github.com/tcnksm/ghr + +test: deps + go test -lint: deps - go vet ./... - golint -set_exit_status ./... +lint: devel-deps + go vet + golint -set_exit_status -cover: deps +cover: devel-deps goveralls -.PHONY: test deps lint cover +build: deps + go build -ldflags=$(BUILD_LDFLAGS) ./cmd/goxz + +crossbuild: devel-deps + $(eval ver = $(shell gobump show -r)) + goxz -pv=v$(ver) -build-ldflags=$(BUILD_LDFLAGS) \ + -d=./dist/v$(ver) ./cmd/go-timeout + +release: + _tools/releng + _tools/upload_artifacts + +.PHONY: test deps test-deps devel-deps lint cover crossbuild release diff --git a/README.md b/README.md index 300241c..abdfba6 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,6 @@ Timeout invocation. Go porting of GNU timeout Run a given command with a time limit. -## Disclaimer - -This software is still alpha quality. We may change APIs without notice. - ## Synopsis tio := &timeout.Timeout{ diff --git a/_tools/releng b/_tools/releng new file mode 100755 index 0000000..6be0bc4 --- /dev/null +++ b/_tools/releng @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +echo current version: $(gobump show -r) +read -p "input next version: " next_version + +gobump set $next_version -w +ghch -w -N v$next_version + +git add version.go CHANGELOG.md +git ci -m "Checking in changes prior to tagging of version v$next_version" +git tag v$next_version +git push && git push --tags diff --git a/_tools/upload_artifacts b/_tools/upload_artifacts new file mode 100755 index 0000000..67e1bfa --- /dev/null +++ b/_tools/upload_artifacts @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +ver=v$(gobump show -r) +make crossbuild +ghr $ver dist/$ver diff --git a/tool/cover.sh b/tool/cover.sh deleted file mode 100755 index 8142137..0000000 --- a/tool/cover.sh +++ /dev/null @@ -1,28 +0,0 @@ -#/bin/sh -# Calculate coverage -# run this and you can see coverage reports as following -# % go tool cover -html .profile.cov -set -e - -prof=${1:-".profile.cov"} -echo "mode: count" > $prof - -cleanup() { - if [ $tmpprof != "" ] && [ -f $tmpprof ]; then - rm -f $tmpprof - fi - exit -} -trap cleanup INT QUIT TERM EXIT - -# cmd/cover doesn't support -coverprofile for multiple packages, so run tests in each dir. -# ref. https://github.com/mattn/goveralls/issues/20 -gopath1=$(echo $GOPATH | cut -d: -f1) -for pkg in $(go list ./...); do - tmpprof=$gopath1/src/$pkg/profile.tmp - go test -covermode=count -coverprofile=$tmpprof $pkg - if [ -f $tmpprof ]; then - cat $tmpprof | tail -n +2 >> $prof - rm $tmpprof - fi -done diff --git a/version.go b/version.go new file mode 100644 index 0000000..30860ba --- /dev/null +++ b/version.go @@ -0,0 +1,5 @@ +package timeout + +const version = "0.1.0" + +var revision = "Devel"