Verified on Gitea 1.27.3: releases/latest/download/<file> does not redirect to a release's assets (404), so that update-feed endpoint is dead. Only raw/branch/master/latest.json works; keep that one in release.env and tauri.conf.json and document it as the mandatory feed in RELEASING.md. Also drop the AppImage (user: it is huge and we don't need it): bundle targets become nsis+deb, build-release.sh only builds the .deb on Linux, and make-latest-json.sh no longer writes a Linux platform entry at all (Debian builds don't self-update). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
61 lines
1.9 KiB
Bash
Executable File
61 lines
1.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Writes <dir>/latest.json, the update feed the app reads, from the signed
|
|
# release artifacts in <dir>:
|
|
# windows-x86_64 -> *_<version>_x64-setup.exe (+ .sig)
|
|
# Debian builds do not self-update, so the .deb is not listed here (it is
|
|
# still a release asset, just not part of the feed).
|
|
# The download URLs point at ${RELEASE_BASE_URL}/releases/download/v<version>/
|
|
# (scripts/release.env).
|
|
#
|
|
# Usage: scripts/make-latest-json.sh <version> <dir>
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd -P)"
|
|
|
|
die() {
|
|
echo "make-latest-json: $*" >&2
|
|
exit 1
|
|
}
|
|
|
|
[ "$#" -eq 2 ] || die "usage: scripts/make-latest-json.sh <version> <dir>"
|
|
VERSION="$1"
|
|
DIR="$2"
|
|
[ -d "${DIR}" ] || die "no such directory: ${DIR}"
|
|
command -v jq >/dev/null 2>&1 || die "jq not found on PATH"
|
|
|
|
# shellcheck source=release.env
|
|
source "${SCRIPT_DIR}/release.env"
|
|
|
|
# The one file in DIR matching the glob $1, with its .sig next to it.
|
|
signed_file() {
|
|
local matches=()
|
|
local file
|
|
for file in "${DIR}"/$1; do
|
|
[ -f "${file}" ] && matches+=("${file}")
|
|
done
|
|
[ "${#matches[@]}" -eq 1 ] || die "expected exactly one $1 in ${DIR}, found ${#matches[@]}"
|
|
[ -s "${matches[0]}.sig" ] || die "missing signature ${matches[0]}.sig"
|
|
echo "${matches[0]}"
|
|
}
|
|
|
|
WINDOWS="$(signed_file "*_${VERSION}_x64-setup.exe")"
|
|
|
|
jq -n \
|
|
--arg version "${VERSION}" \
|
|
--arg pub_date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
--arg base "${RELEASE_BASE_URL}/releases/download/v${VERSION}" \
|
|
--arg windows_file "$(basename "${WINDOWS}")" \
|
|
--rawfile windows_sig "${WINDOWS}.sig" \
|
|
'{
|
|
version: $version,
|
|
pub_date: $pub_date,
|
|
platforms: {
|
|
"windows-x86_64": {
|
|
signature: ($windows_sig | gsub("\\s"; "")),
|
|
url: "\($base)/\($windows_file | @uri)"
|
|
}
|
|
}
|
|
}' >"${DIR}/latest.json"
|
|
|
|
echo "Wrote ${DIR}/latest.json"
|