Skip to content

Commit

Permalink
Update goreleaser to not need tag env var
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSGK committed Nov 16, 2023
1 parent dda8cc9 commit ac9674b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builds:
# - windows
- darwin
ldflags:
- -X "main.version={{.Env.CLI_TAG}}"
- -X "main.version={{.Version}}"

archives:
- format: tar.gz
Expand Down Expand Up @@ -85,7 +85,7 @@ blobs:
#
# Default: '{{ .ProjectName }}/{{ .Tag }}'
# Templates: allowed
folder: "{{ .Tag }}"
folder: "{{.Version}}"

# Whether to disable this particular upload configuration.
#
Expand Down
5 changes: 2 additions & 3 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# First, ensure that the github token is set
if [[ -z $GITHUB_TOKEN ]]; then
echo Github token not found.
echo Github token not found.
echo "Please set your github token via \"export GITHUB_TOKEN=<your-gh-token>\" and try again."
exit 1
fi
Expand All @@ -13,7 +13,7 @@ echo What would you like the new tag to be?
read new_tag
tag_message=`git --no-pager log -1 --pretty=%s`

echo Pushing $new_tag: $tag_message.
echo Pushing $new_tag: $tag_message.
read -p "Continue? [y/N] " yn
case $yn in
[Yy]* ) echo Pushing to remote...;;
Expand All @@ -31,5 +31,4 @@ case $yn in
esac

# Build & release, setting the tag as the lekko cli version via ldflags.
export CLI_TAG=$new_tag
goreleaser release --clean

0 comments on commit ac9674b

Please sign in to comment.