Skip to content

Commit

Permalink
Updated goreleaser process
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo Prieto committed Jul 20, 2021
1 parent af1eb10 commit 98a5e2a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ script:
deploy:
- provider: script
skip_cleanup: true
script: curl -sL https://git.io/goreleaser | bash
script: bash scripts/goreleaser.sh
on:
tags: true
condition: "$TRAVIS_OS_NAME = linux"
30 changes: 30 additions & 0 deletions scripts/goreleaser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
set -e

TAR_FILE="/tmp/goreleaser.tar.gz"
RELEASES_URL="https://github.com/goreleaser/goreleaser/releases"
PINNED_VERSION="v0.173.2"

test -z "$TMPDIR" && TMPDIR="$(mktemp -d)"

pinned_version() {
curl -sL -o /dev/null -w %{url_effective} "$RELEASES_URL/$PINNED_VERSION" |
rev |
cut -f1 -d'/'|
rev
}

download() {
test -z "$VERSION" && VERSION="$(pinned_version)"
test -z "$VERSION" && {
echo "Unable to get goreleaser version." >&2
exit 1
}
rm -f "$TAR_FILE"
curl -s -L -o "$TAR_FILE" \
"$RELEASES_URL/download/$VERSION/goreleaser_$(uname -s)_$(uname -m).tar.gz"
}

download
tar -xf "$TAR_FILE" -C "$TMPDIR"
"${TMPDIR}/goreleaser" "$@"

0 comments on commit 98a5e2a

Please sign in to comment.