diff --git a/.travis.yml b/.travis.yml index 0e1baeb0..6f03eec7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,8 @@ sudo: false install: - go get golang.org/x/lint/golint - - go get github.com/haya14busa/reviewdog/cmd/reviewdog + - curl -L -o $HOME/bin/reviewdog https://github.com/haya14busa/reviewdog/releases/download/0.9.11/reviewdog_linux_amd64 + - chmod a+x $HOME/bin/reviewdog script: - reviewdog -reporter=github-pr-check diff --git a/linebot/version.go b/linebot/version.go index 1952403c..675c486a 100644 --- a/linebot/version.go +++ b/linebot/version.go @@ -14,4 +14,4 @@ package linebot -const version = "1.0.0" +const version = "3.0.0" diff --git a/script/tag.sh b/script/tag.sh new file mode 100644 index 00000000..57109556 --- /dev/null +++ b/script/tag.sh @@ -0,0 +1,70 @@ +# Copyright 2018 LINE Corporation +# +# LINE Corporation licenses this file to you under the Apache License, +# version 2.0 (the "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# Update and commit linebot/version.go and create a new tag. +# +# Usage: +# bash script/tag.sh v3.0.0 + +if [ $# -gt 1 ]; then + echo "too many arguments" > /dev/stderr + echo 'Usage: tag.sh $TAG' > /dev/stderr + exit 1 +fi + +if [ $# -lt 1 ]; then + echo "TAG argument is required" > /dev/stderr + echo 'Usage: tag.sh $TAG' > /dev/stderr + exit 1 +fi + +TAG=$1 +echo "TAG: $TAG" +VERSION=${TAG#v} + +if [ "$TAG" = "$VERSION" ]; then + echo "TAG must start with 'v'" + exit 1 +fi + +echo "cd `dirname $0`/.." +cd `dirname $0`/.. + +echo "create linebot/version.go" +cat << EOS > linebot/version.go +// Copyright 2016 LINE Corporation +// +// LINE Corporation licenses this file to you under the Apache License, +// version 2.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. +// +// Don't edit this file directly. This file is generated by script/tag.sh . + +package linebot + +const version = "$VERSION" +EOS + +git add linebot/version.go +git commit -m "Update version to $TAG" +echo "git tag $TAG" +git tag $TAG