mirror of
https://github.com/denisidoro/navi
synced 2024-11-25 13:00:20 +00:00
52 lines
No EOL
1 KiB
Bash
Executable file
52 lines
No EOL
1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
export NAVI_HOME="$(cd "$(dirname "$0")/.." && pwd)"
|
|
source "${NAVI_HOME}/src/main.sh"
|
|
|
|
sha256() {
|
|
if command_exists sha256sum; then
|
|
sha256sum
|
|
elif command_exists shasum; then
|
|
shasum -a 256
|
|
elif command_exists openssl; then
|
|
openssl dgst -sha256
|
|
else
|
|
echoerr "Unable to calculate sha256!"
|
|
exit 43
|
|
fi
|
|
}
|
|
|
|
header() {
|
|
echo "$*"
|
|
echo
|
|
}
|
|
|
|
cd "$NAVI_HOME"
|
|
|
|
header "git pull"
|
|
git pull
|
|
|
|
version="$(grep VERSION "${NAVI_HOME}/navi" | grep -Eo '[0-9\.]+')"
|
|
tag="v${version}"
|
|
tar="https://github.com/denisidoro/navi/archive/${tag}.tar.gz"
|
|
formula="/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/navi.rb"
|
|
|
|
header "Attempting to release version ${tag}..."
|
|
read -p "Press enter to continue"
|
|
|
|
header "git tag"
|
|
git tag -a "$tag" -m "$tag"
|
|
|
|
header "git push"
|
|
git push --follow-tags
|
|
|
|
header "rm formula"
|
|
rm "$formula" 2>/dev/null || true
|
|
|
|
header "tar sha256"
|
|
sha="$(curl -sL "$tar" | sha256 | awk '{print $1}')"
|
|
|
|
header "output"
|
|
echo " url \"${tar}\""
|
|
echo " sha256 \"${sha}\"" |