feat #14740: fallback update endpoint
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,16 +91,19 @@ if [ "${key_of_signature}" != "${key_of_config}" ]; then
|
||||
fi
|
||||
|
||||
# --- Version and update feed ------------------------------------------------
|
||||
echo "Setting version ${VERSION} and update feed ${UPDATE_JSON_URL}"
|
||||
# Rewrites a JSON file in place, keeping its permissions.
|
||||
[ "${#UPDATE_JSON_URLS[@]}" -gt 0 ] || die "UPDATE_JSON_URLS in release.env is empty"
|
||||
echo "Setting version ${VERSION} and update feeds ${UPDATE_JSON_URLS[*]}"
|
||||
# Rewrites a JSON file in place (read from stdin, so `--args` can come
|
||||
# last), keeping its permissions.
|
||||
jq_in_place() {
|
||||
local file="$1"
|
||||
shift
|
||||
jq "$@" "${file}" >"${WORK_DIR}/edit.json"
|
||||
jq "$@" <"${file}" >"${WORK_DIR}/edit.json"
|
||||
cat "${WORK_DIR}/edit.json" >"${file}"
|
||||
}
|
||||
jq_in_place "${CONF}" --arg version "${VERSION}" --arg url "${UPDATE_JSON_URL}" \
|
||||
'.version = $version | .plugins.updater.endpoints = [$url]'
|
||||
jq_in_place "${CONF}" --arg version "${VERSION}" \
|
||||
'.version = $version | .plugins.updater.endpoints = $ARGS.positional' \
|
||||
--args "${UPDATE_JSON_URLS[@]}"
|
||||
jq_in_place "${PACKAGE_JSON}" --arg version "${VERSION}" '.version = $version'
|
||||
# The first `version = …` line is the one of [package].
|
||||
sed -i -E "0,/^version = \"[^\"]*\"/s//version = \"${VERSION}\"/" "${CARGO_TOML}"
|
||||
|
||||
+11
-7
@@ -1,14 +1,18 @@
|
||||
# Where Gesprächsrekorder releases are published: the one place to change.
|
||||
# Sourced by build-release.sh, which writes UPDATE_JSON_URL into
|
||||
# Sourced by build-release.sh, which writes UPDATE_JSON_URLS into
|
||||
# src-tauri/tauri.conf.json (plugins.updater.endpoints), and by
|
||||
# make-latest-json.sh, which points the download URLs in latest.json at
|
||||
# ${RELEASE_BASE_URL}/releases/download/v<version>/<file>. See RELEASING.md.
|
||||
|
||||
RELEASE_BASE_URL="https://gitea.euvino.eu/public/call-recorder"
|
||||
|
||||
# Where the app looks for latest.json.
|
||||
# A (default): latest.json is an asset of the newest release.
|
||||
UPDATE_JSON_URL="${RELEASE_BASE_URL}/releases/latest/download/latest.json"
|
||||
# B: latest.json is committed to the root of master (if Gitea does not
|
||||
# serve releases/latest/download/…):
|
||||
# UPDATE_JSON_URL="${RELEASE_BASE_URL}/raw/branch/master/latest.json"
|
||||
# Where the app looks for latest.json, tried in this order until one answers
|
||||
# with a release:
|
||||
# 1. latest.json as an asset of the newest release,
|
||||
# 2. latest.json committed to the root of master.
|
||||
# Once it is clear which one Gitea serves, the other can be dropped here (it
|
||||
# then disappears from the next version built).
|
||||
UPDATE_JSON_URLS=(
|
||||
"${RELEASE_BASE_URL}/releases/latest/download/latest.json"
|
||||
"${RELEASE_BASE_URL}/raw/branch/master/latest.json"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user