feat(launcher): Linux play wrapper, patch UX, Gitea sync cleanup
- Play on Linux: use launch.linux_wrapper (wine) or linux_steam_uri; chmod .exe after install - Windows: retry EBUSY on MPQ replace; download to .new before rename - After successful sync: remove .bak-* backups; realmlist only Data/enUS (ignore enGB) - Gitea/distro merge: skip Fractured-Launcher* from GitHub assets (CI default-branch build wins) - Omit blockmap and builder-debug from staged artifacts and Gitea uploads; upload script validates before clearing attachments - README and launcher version 1.0.12 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
# Shared filters for GitHub → Gitea / distro release merges and Gitea uploads.
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Skip when copying assets from `gh release download` into combined/: CI-built launcher is authoritative.
|
||||
should_skip_merge_from_github() {
|
||||
local l
|
||||
l=$(printf '%s' "${1##*/}" | tr '[:upper:]' '[:lower:]')
|
||||
case "$l" in
|
||||
fractured-launcher*) return 0 ;;
|
||||
*.blockmap) return 0 ;;
|
||||
builder-debug.yml|builder-debug.yaml) return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
# Skip when POSTing attachments to Gitea (belt-and-suspenders if something slips into combined/).
|
||||
should_skip_gitea_upload() {
|
||||
local l
|
||||
l=$(printf '%s' "${1##*/}" | tr '[:upper:]' '[:lower:]')
|
||||
case "$l" in
|
||||
*.blockmap) return 0 ;;
|
||||
builder-debug.yml|builder-debug.yaml) return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
@@ -11,6 +11,10 @@
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=release-sync-filters.sh
|
||||
. "$SCRIPT_DIR/release-sync-filters.sh"
|
||||
|
||||
COMBINED_DIR="${1:?first arg: directory of files to attach}"
|
||||
TAG="${2:?second arg: release tag (e.g. v1.0.0)}"
|
||||
|
||||
@@ -67,12 +71,6 @@ if [ -z "$rel_id" ] || [ "$rel_id" = "null" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while read -r aid; do
|
||||
[ -z "$aid" ] || [ "$aid" = "null" ] && continue
|
||||
curl -fsS -X DELETE "${AUTH_H[@]}" \
|
||||
"$API/repos/${GITEA_OWNER}/${GITEA_REPO}/releases/${rel_id}/assets/${aid}" || true
|
||||
done < <(jq -r '(.attachments // .assets // [])[] | .id' "$REL_JSON")
|
||||
|
||||
shopt -s nullglob
|
||||
files=("$COMBINED_DIR"/*)
|
||||
if [ "${#files[@]}" -eq 0 ]; then
|
||||
@@ -80,12 +78,39 @@ if [ "${#files[@]}" -eq 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
uploadable=0
|
||||
for f in "${files[@]}"; do
|
||||
[ -f "$f" ] || continue
|
||||
echo "Uploading $(basename "$f") …"
|
||||
bn=$(basename "$f")
|
||||
if should_skip_gitea_upload "$bn"; then
|
||||
continue
|
||||
fi
|
||||
uploadable=$((uploadable + 1))
|
||||
done
|
||||
if [ "$uploadable" -eq 0 ]; then
|
||||
echo "No files to upload after exclusions (check $COMBINED_DIR) — not clearing Gitea attachments." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while read -r aid; do
|
||||
[ -z "$aid" ] || [ "$aid" = "null" ] && continue
|
||||
curl -fsS -X DELETE "${AUTH_H[@]}" \
|
||||
"$API/repos/${GITEA_OWNER}/${GITEA_REPO}/releases/${rel_id}/assets/${aid}" || true
|
||||
done < <(jq -r '(.attachments // .assets // [])[] | .id' "$REL_JSON")
|
||||
|
||||
uploaded=0
|
||||
for f in "${files[@]}"; do
|
||||
[ -f "$f" ] || continue
|
||||
bn=$(basename "$f")
|
||||
if should_skip_gitea_upload "$bn"; then
|
||||
echo "Skipping upload (excluded): $bn"
|
||||
continue
|
||||
fi
|
||||
echo "Uploading $bn …"
|
||||
curl -fsS -X POST "${AUTH_H[@]}" \
|
||||
-F "attachment=@${f}" \
|
||||
"$API/repos/${GITEA_OWNER}/${GITEA_REPO}/releases/${rel_id}/assets"
|
||||
uploaded=$((uploaded + 1))
|
||||
done
|
||||
|
||||
echo "Gitea release $TAG (id=$rel_id) updated with ${#files[@]} file(s)."
|
||||
echo "Gitea release $TAG (id=$rel_id) updated with $uploaded file(s)."
|
||||
|
||||
Reference in New Issue
Block a user