From d6162e943ba786ffa0680bfb1c7fb7084bac5b52 Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Tue, 30 Oct 2018 09:00:11 -0600 Subject: [PATCH] fix goreleaser bugs Signed-off-by: Steve Kriss --- .goreleaser.yml | 4 ++-- hack/goreleaser.sh | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index c6616c62a..33a43a526 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -36,9 +36,9 @@ builds: - goos: windows goarch: arm64 ldflags: - - -X "github.com/heptio/ark/pkg/buildinfo.Version={{ .Version }}" -X "github.com/heptio/ark/pkg/buildinfo.GitSHA={{ .Env.GIT_SHA }}" -X "github.com/heptio/ark/pkg/buildinfo.GitTreeState={{ .Env.GIT_TREE_STATE }}" + - -X "github.com/heptio/ark/pkg/buildinfo.Version={{ .Tag }}" -X "github.com/heptio/ark/pkg/buildinfo.GitSHA={{ .Env.GIT_SHA }}" -X "github.com/heptio/ark/pkg/buildinfo.GitTreeState={{ .Env.GIT_TREE_STATE }}" archive: - name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}" + name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}" files: - LICENSE - examples/**/* diff --git a/hack/goreleaser.sh b/hack/goreleaser.sh index aaec9e940..b760895a0 100755 --- a/hack/goreleaser.sh +++ b/hack/goreleaser.sh @@ -18,15 +18,7 @@ set -o errexit set -o nounset set -o pipefail -# $PUBLISH must explicitly be set to 'true' for goreleaser -# to publish the release to GitHub. -if [ "${PUBLISH:-}" != "true" ]; then - SKIP_PUBLISH="--skip-publish" -else - SKIP_PUBLISH="" -fi - -if [ -z "${GITHUB_TOKEN}" ]; then +if [[ -z "${GITHUB_TOKEN}" ]]; then echo "GITHUB_TOKEN must be set" exit 1 fi @@ -46,7 +38,15 @@ else export GIT_TREE_STATE=dirty fi -goreleaser release \ - --rm-dist \ - --release-notes="${RELEASE_NOTES_FILE}" \ - "${SKIP_PUBLISH}" +# $PUBLISH must explicitly be set to 'true' for goreleaser +# to publish the release to GitHub. +if [[ "${PUBLISH:-}" != "true" ]]; then + goreleaser release \ + --rm-dist \ + --release-notes="${RELEASE_NOTES_FILE}" \ + --skip-publish +else + goreleaser release \ + --rm-dist \ + --release-notes="${RELEASE_NOTES_FILE}" +fi