From 8292ab7d2c191e27da5759d128415a8b1362b896 Mon Sep 17 00:00:00 2001 From: tsuyoshiwada Date: Sun, 18 Feb 2018 22:57:17 +0900 Subject: [PATCH] chore: Add release process --- .gitignore | 1 + .travis.yml | 4 +--- Makefile | 1 + scripts/release.sh | 6 ++++++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100755 scripts/release.sh diff --git a/.gitignore b/.gitignore index 876121fb..6182e02f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /tmp /.tmp +/dist # Created by https://www.gitignore.io/api/osx,macos,go diff --git a/.travis.yml b/.travis.yml index 508713cc..67890fbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,4 @@ branches: only: - master after_success: - - echo "TODO release process" - # - gox -os "darwin linux windows" -arch "amd64" -output "dist/{{.OS}}_{{.Arch}}_{{.Dir}}" . - # - ghr --username tsuyoshiwada --token $GITHUB_TOKEN --replace `grep 'Version =' version.go | sed -E 's/.*"(.+)"$$/\1/'` dist/ + - ./scripts/release.sh diff --git a/Makefile b/Makefile index e01fec9e..126db51a 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ deps: .PHONY: clean clean: rm -rf ./vendor/ + rm -rf ./dist/ rm -rf ./git-chglog rm -rf $(GOPATH)/bin/git-chglog diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 00000000..dfc149c0 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +if [[ "$TRAVIS_BRANCH" == "master" ]]; then + gox -os="darwin linux windows" -arch="amd64 386" -output="$(pwd)/dist/{{.Dir}}_{{.OS}}_{{.Arch}}" ./cmd/git-chglog + ghr --username git-chglog --token $GITHUB_TOKEN --replace `grep 'Version =' ./cmd/git-chglog/version.go | sed -E 's/.*"(.+)"$$/\1/'` dist/ +fi