28 lines
727 B
Bash
Executable File
28 lines
727 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
api="https://api.github.com/repos/acmagn/ratune/releases/latest"
|
|
json="$(curl --fail --silent --show-error --retry 3 "$api")"
|
|
tag="$(jq -er '.tag_name | select(test("^v[0-9]+\\.[0-9]+\\.[0-9]+"))' <<<"$json")"
|
|
version="${tag#v}"
|
|
current="$(tr -d '[:space:]' < .current-version 2>/dev/null || true)"
|
|
|
|
echo "Latest Ratune release: $tag"
|
|
echo "Previously published: ${current:-none}"
|
|
|
|
if [[ "$tag" == "$current" ]]; then
|
|
echo "Release already published; skipping."
|
|
{
|
|
echo "tag=$tag"
|
|
echo "version=$version"
|
|
echo "skip=true"
|
|
} >> "${GITHUB_OUTPUT:-/dev/null}"
|
|
exit 0
|
|
fi
|
|
|
|
{
|
|
echo "tag=$tag"
|
|
echo "version=$version"
|
|
echo "skip=false"
|
|
} >> "${GITHUB_OUTPUT:-/dev/null}"
|