Skip to content

Commit

Permalink
fix goreleaser bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kriss <[email protected]>
  • Loading branch information
skriss committed Oct 30, 2018
1 parent beb22f9 commit d6162e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*
Expand Down
26 changes: 13 additions & 13 deletions hack/goreleaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit d6162e9

Please sign in to comment.