• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3set -e
4set -o pipefail
5
6if [[ -z $GITHUB_TOKEN ]]; then
7	echo "No GITHUB_TOKEN secret found, artifact publishing skipped"
8	exit
9fi
10
11if ! hash ghr 2> /dev/null; then
12	_GHR_VER=v0.14.0
13	_GHR=ghr_${_GHR_VER}_linux_amd64
14	mkdir -p $HOME/.local/bin
15	curl -sfL https://github.com/tcnksm/ghr/releases/download/$_GHR_VER/$_GHR.tar.gz |
16		tar xz -C $HOME/.local/bin --strip-components=1 $_GHR/ghr
17fi
18
19ghr -replace \
20	-u $CIRCLE_PROJECT_USERNAME \
21	-r $CIRCLE_PROJECT_REPONAME \
22	$CIRCLE_TAG \
23	$1
24