1#!/bin/sh
2
3set -e
4
5tag=r$(./release_num.sh)
6
7GITHUB_TOKEN="$1"
8PROJECT_USERNAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f1)
9PROJECT_REPONAME=$(echo $GITHUB_REPOSITORY | cut -d'/' -f2)
10
11# ghr uses Zigmod to build itself, so we need to use the binary to build Zigmod
12curl -s https://api.github.com/repos/nektro/ghr/releases | jq -r '.[0].assets[].browser_download_url' | grep $(uname -m) | grep linux | wget -i -
13chmod +x ./ghr-linux-x86_64
14./ghr-linux-x86_64 \
15 -t ${GITHUB_TOKEN} \
16 -u ${PROJECT_USERNAME} \
17 -r ${PROJECT_REPONAME} \
18 -b "$(./changelog.sh)" \
19 -n "$tag" \
20 "$tag" \
21 "./bin/"