From c20c3621c6c29d480360b4ecccfac56a1961e8e5 Mon Sep 17 00:00:00 2001 From: wweir Date: Mon, 21 Jan 2019 11:19:16 +0800 Subject: [PATCH] Change release filenames @release --- .circleci/config.yml | 10 ++++++---- deploy/install | 6 +++--- deploy/uninstall | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b37012..2b63522 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,22 +16,24 @@ jobs: name: build linux Binary command: | make build - tar czvf artifacts/sower-linux.tar.gz sower sower.toml sower-client.service sower-server.service + tar czvf artifacts/sower_linux_amd64.tar.gz sower sower.toml sower-client.service sower-server.service - run: name: build macOS Binary command: | GOOS=darwin GOARCH=amd64 make build - tar czvf artifacts/sower-darwin.tar.gz sower sower.toml cc.wweir.sower.plist + tar czvf artifacts/sower_darwin_amd64.tar.gz sower sower.toml cc.wweir.sower.plist - run: name: build Windows Binary command: | GOOS=windows GOARCH=amd64 make build - tar czvf artifacts/sower-windows.tar.gz sower sower.toml + tar czvf artifacts/sower_windows_amd64.tar.gz sower sower.toml - run: name: Publish Release on GitHub command: | if git log -1 --pretty='%s' | grep -oE '(^|\s)@release(\s|$)'; then - go get github.com/tcnksm/ghr + GHR_VERSION="$(curl -s "https://api.github.com/repos/tcnksm/ghr/releases/latest" | awk -F '"' '/tag_name/{printf $4}')" + curl -SLf https://github.com/tcnksm/ghr/releases/download/"$GHR_VERSION"/ghr_"$GHR_VERSION"_linux_amd64.tar.gz | tar xzC /usr/local/bin --strip-components=1 + VERSION=$(git describe --tags) ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION%-*-*} artifacts/ fi diff --git a/deploy/install b/deploy/install index 5b5021a..7ccc4a9 100755 --- a/deploy/install +++ b/deploy/install @@ -19,7 +19,7 @@ case "$(uname -s)" in read ADDRESS echo - curl -SLf https://github.com/wweir/sower/releases/download/$VERSION/sower-darwin.tar.gz | tar xzv + curl -SLf https://github.com/wweir/sower/releases/download/$VERSION/sower_darwin_amd64.tar.gz | tar xzv mv sower /usr/local/bin/ @@ -51,7 +51,7 @@ case "$(uname -s)" in read ADDRESS echo - curl -SLf https://github.com/wweir/sower/releases/download/$VERSION/sower-linux.tar.gz | tar xzv + curl -SLf https://github.com/wweir/sower/releases/download/$VERSION/sower_linux_amd64.tar.gz | tar xzv sudo mv sower /usr/local/bin/ @@ -65,7 +65,7 @@ case "$(uname -s)" in ;; "s") - curl -SLf https://github.com/wweir/sower/releases/download/$VERSION/sower-linux.tar.gz | tar xzv + curl -SLf https://github.com/wweir/sower/releases/download/$VERSION/sower_linux_amd64.tar.gz | tar xzv sudo mv sower /usr/local/bin/ sudo mv sower-server.service /etc/systemd/system/ diff --git a/deploy/uninstall b/deploy/uninstall index 54502e4..25404b1 100755 --- a/deploy/uninstall +++ b/deploy/uninstall @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -u -x +set -u -x -e # main logic case "$(uname -s)" in