#!/bin/sh # Which Super Productivity release, and the sha512 of its .deb, straight from the # update channel the desktop clients themselves follow (`latest-linux.yml`). # # resolve-version.sh the newest release # resolve-version.sh 19.1.0 that release # # Prints two lines, `version=` and `sha512=`, so a workflow can append the # output to $GITHUB_OUTPUT as it is. Gitea #156: the test image follows the channel # rather than a pin, because installed apps update on their own and a pinned old # version would be tested against while users run the new one. set -eu base=https://github.com/super-productivity/super-productivity/releases if [ "${1:-latest}" = latest ]; then url="$base/latest/download/latest-linux.yml" else url="$base/download/v$1/latest-linux.yml" fi yml="$(curl -fsSL "$url")" version="$(printf '%s\n' "$yml" | sed -n 's/^version: *//p' | head -n 1)" sha512="$(printf '%s\n' "$yml" | awk '/url: superProductivity-amd64\.deb/ {found=1; next} found && /sha512:/ {print $2; exit}')" if [ -z "$version" ] || [ -z "$sha512" ]; then echo "resolve-version: no version/sha512 for the amd64 .deb in $url" >&2 exit 1 fi printf 'version=%s\nsha512=%s\n' "$version" "$sha512"