27 lines
1.0 KiB
Bash
Executable File
27 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ $# -ne 2 ]]; then
|
|
printf 'Usage: %s TAG REPOSITORY_URL\n' "$0" >&2
|
|
exit 1
|
|
fi
|
|
|
|
TAG=$1
|
|
REPOSITORY_URL=${2%/}
|
|
git rev-parse --verify "$TAG^{commit}" >/dev/null
|
|
# Start at the parent so the release being built cannot match itself.
|
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match 'v[0-9]*' "$TAG^" 2>/dev/null || true)
|
|
|
|
printf '## Installation / Update\n\n'
|
|
printf '```sh\ncurl -fsSL %s/releases/download/%s/install.sh | bash\n```\n\n' "$REPOSITORY_URL" "$TAG"
|
|
printf 'The installer is attached to this release. It checks dependencies and verifies binary SHA-256 checksums before installation. Python is not required.\n\n'
|
|
printf 'Download `checksums.txt` to verify the attached binaries and `install.sh`.\n\n'
|
|
printf '## Changes\n\n'
|
|
if [[ -n "$PREVIOUS_TAG" ]]; then
|
|
printf 'Changes since `%s`:\n\n' "$PREVIOUS_TAG"
|
|
git log --no-merges --format='- %s (%h)' "$PREVIOUS_TAG..$TAG"
|
|
else
|
|
printf 'Initial release:\n\n'
|
|
git log --no-merges --format='- %s (%h)' "$TAG"
|
|
fi
|