mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-08 14:14:19 +00:00
fix: add error handling for Xray, geo, and toolchain downloads in CI
This commit is contained in:
parent
314c4e75d7
commit
5ec81ea3d0
1 changed files with 16 additions and 5 deletions
21
.github/workflows/release.yml
vendored
21
.github/workflows/release.yml
vendored
|
|
@ -132,10 +132,11 @@ jobs:
|
||||||
XRAY_FILE="${XRAY_MAP[${{ matrix.platform }}]}"
|
XRAY_FILE="${XRAY_MAP[${{ matrix.platform }}]}"
|
||||||
[ -z "$XRAY_FILE" ] && { echo "Unknown platform: ${{ matrix.platform }}" >&2; exit 1; }
|
[ -z "$XRAY_FILE" ] && { echo "Unknown platform: ${{ matrix.platform }}" >&2; exit 1; }
|
||||||
mkdir -p /tmp/xray
|
mkdir -p /tmp/xray
|
||||||
curl -fL -sS --retry 3 --retry-delay 5 -o "/tmp/xray/$XRAY_FILE" "${Xray_URL}${XRAY_FILE}"
|
curl -fL -sS --retry 3 --retry-delay 5 -o "/tmp/xray/$XRAY_FILE" "${Xray_URL}${XRAY_FILE}" || { echo "Failed to download Xray" >&2; exit 1; }
|
||||||
cd /tmp/xray
|
cd /tmp/xray
|
||||||
unzip -q "$XRAY_FILE"
|
unzip -q "$XRAY_FILE" || { echo "Failed to unzip Xray" >&2; exit 1; }
|
||||||
rm -f "$XRAY_FILE"
|
rm -f "$XRAY_FILE"
|
||||||
|
[ -f xray ] || { echo "xray binary not found after extraction" >&2; exit 1; }
|
||||||
|
|
||||||
- name: Get cache date
|
- name: Get cache date
|
||||||
id: cache_date
|
id: cache_date
|
||||||
|
|
@ -165,7 +166,17 @@ jobs:
|
||||||
https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat &
|
https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat &
|
||||||
curl -fL -sS --retry 3 -o geosite_RU.dat \
|
curl -fL -sS --retry 3 -o geosite_RU.dat \
|
||||||
https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat &
|
https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat &
|
||||||
wait
|
FAILED=0
|
||||||
|
for job in $(jobs -p); do wait "$job" || FAILED=1; done
|
||||||
|
if [ "$FAILED" -eq 1 ]; then
|
||||||
|
echo "One or more geo data downloads failed" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
for f in *.dat; do
|
||||||
|
if [ ! -s "$f" ]; then
|
||||||
|
echo "Geo file $f is empty" >&2; exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Cache Bootlin toolchain
|
- name: Cache Bootlin toolchain
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
|
|
@ -201,8 +212,8 @@ jobs:
|
||||||
[ -z "$TARBALL_URL" ] && { echo "Failed to locate Bootlin musl toolchain for arch=$BOOTLIN_ARCH" >&2; exit 1; }
|
[ -z "$TARBALL_URL" ] && { echo "Failed to locate Bootlin musl toolchain for arch=$BOOTLIN_ARCH" >&2; exit 1; }
|
||||||
echo "Downloading: $TARBALL_URL"
|
echo "Downloading: $TARBALL_URL"
|
||||||
cd /tmp/toolchain
|
cd /tmp/toolchain
|
||||||
curl -fL -sS --retry 3 --retry-delay 5 -o "$(basename "$TARBALL_URL")" "$TARBALL_BASE/$TARBALL_URL"
|
curl -fL -sS --retry 3 --retry-delay 5 -o "$(basename "$TARBALL_URL")" "$TARBALL_BASE/$TARBALL_URL" || { echo "Failed to download toolchain" >&2; exit 1; }
|
||||||
tar -xf "$(basename "$TARBALL_URL")"
|
tar -xf "$(basename "$TARBALL_URL")" || { echo "Failed to extract toolchain tarball" >&2; exit 1; }
|
||||||
TOOLCHAIN_DIR=$(find /tmp/toolchain -maxdepth 1 -type d -name "${BOOTLIN_ARCH}--musl--stable-*" | head -n1)
|
TOOLCHAIN_DIR=$(find /tmp/toolchain -maxdepth 1 -type d -name "${BOOTLIN_ARCH}--musl--stable-*" | head -n1)
|
||||||
cd -
|
cd -
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue