From 0792bc9339b9262c33caae5482748fac21bd4de4 Mon Sep 17 00:00:00 2001 From: Songmu Date: Sun, 7 Jan 2018 15:53:41 +0900 Subject: [PATCH 1/5] adjust meta files --- Makefile | 48 +++++++++++++++++++++++++++++++---------- _tools/releng | 13 +++++++++++ _tools/upload_artifacts | 6 ++++++ tool/cover.sh | 28 ------------------------ version.go | 5 +++++ 5 files changed, 61 insertions(+), 39 deletions(-) create mode 100755 _tools/releng create mode 100755 _tools/upload_artifacts delete mode 100755 tool/cover.sh create mode 100644 version.go 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/_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" From 99441478d0e0c2edeade88786d6f6243db959899 Mon Sep 17 00:00:00 2001 From: Songmu Date: Sun, 7 Jan 2018 15:54:36 +0900 Subject: [PATCH 2/5] add CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CHANGELOG.md 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)) From d5f7f3ffb1b8f2aaa76825ab820d764ecdd3b826 Mon Sep 17 00:00:00 2001 From: Songmu Date: Sun, 7 Jan 2018 15:57:56 +0900 Subject: [PATCH 3/5] add osx testing --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) 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: From 6ce23ad4e87b7d13545c617d93878c7590505b00 Mon Sep 17 00:00:00 2001 From: Songmu Date: Sun, 7 Jan 2018 16:00:15 +0900 Subject: [PATCH 4/5] add gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore 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/ From 949a577d066bc9f111f300af3b8f1ed40519d67f Mon Sep 17 00:00:00 2001 From: Songmu Date: Sun, 7 Jan 2018 16:07:32 +0900 Subject: [PATCH 5/5] remove Disclaimer --- README.md | 4 ---- 1 file changed, 4 deletions(-) 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{