Release: dev to main #7
@@ -22,8 +22,9 @@ cp site/index.html site/404.html site/_headers "$out/"
|
|||||||
name="$(basename "$apk")"
|
name="$(basename "$apk")"
|
||||||
cp "$apk" "$out/$channel/$name"
|
cp "$apk" "$out/$channel/$name"
|
||||||
cp "$apk" "$out/$channel/ProLibertateGames.apk"
|
cp "$apk" "$out/$channel/ProLibertateGames.apk"
|
||||||
jq -n --arg tag "$tag" --arg name "$name" --arg ch "$channel" --arg url "$base/$channel/$name" \
|
# node rather than jq: the Gitea runner's image has node but not jq.
|
||||||
'{tag: $tag, apkName: $name, apkUrl: $url, channel: $ch}' > "$out/$channel/latest.json"
|
node -e 'console.log(JSON.stringify({tag: process.argv[1], apkName: process.argv[2], apkUrl: process.argv[3], channel: process.argv[4]}, null, 2))' \
|
||||||
|
"$tag" "$name" "$base/$channel/$name" "$channel" > "$out/$channel/latest.json"
|
||||||
|
|
||||||
# PLG_SKIP_OTHER=1 is for the very first deploy, when the site does not exist
|
# PLG_SKIP_OTHER=1 is for the very first deploy, when the site does not exist
|
||||||
# yet and the domain answers 403 (Cloudflare error 1014) instead of 404.
|
# yet and the domain answers 403 (Cloudflare error 1014) instead of 404.
|
||||||
@@ -47,13 +48,12 @@ fi
|
|||||||
if [ "$code" = 404 ]; then
|
if [ "$code" = 404 ]; then
|
||||||
echo "No $other channel published yet; skipping."
|
echo "No $other channel published yet; skipping."
|
||||||
rm -rf "$out/$other"
|
rm -rf "$out/$other"
|
||||||
elif [ "$code" = 200 ] && ! jq -e .apkName "$out/$other/latest.json" >/dev/null 2>&1; then
|
elif [ "$code" = 200 ] && ! other_name="$(node -p 'const j = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8")); if (!j.apkName) process.exit(1); j.apkName' "$out/$other/latest.json" 2>/dev/null)"; then
|
||||||
# A 200 that is not our JSON: Pages without a 404.html answers unknown paths
|
# A 200 that is not our JSON: Pages without a 404.html answers unknown paths
|
||||||
# with index.html. Nothing is published on that channel.
|
# with index.html. Nothing is published on that channel.
|
||||||
echo "No $other channel published yet (200 but no latest.json); skipping."
|
echo "No $other channel published yet (200 but no latest.json); skipping."
|
||||||
rm -rf "$out/$other"
|
rm -rf "$out/$other"
|
||||||
elif [ "$code" = 200 ]; then
|
elif [ "$code" = 200 ]; then
|
||||||
other_name="$(jq -er .apkName "$out/$other/latest.json")"
|
|
||||||
curl -fsS -o "$out/$other/$other_name" "$base/$other/$other_name"
|
curl -fsS -o "$out/$other/$other_name" "$base/$other/$other_name"
|
||||||
cp "$out/$other/$other_name" "$out/$other/ProLibertateGames.apk"
|
cp "$out/$other/$other_name" "$out/$other/ProLibertateGames.apk"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user