fix release workflow cross-platform packaging failures

This commit is contained in:
Abolfazl
2026-05-13 01:18:44 +03:30
parent 1a390e580d
commit 34a62cef13
+33 -4
View File
@@ -1,5 +1,8 @@
name: Release name: Release
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
on: on:
push: push:
tags: tags:
@@ -94,8 +97,10 @@ jobs:
shell: pwsh shell: pwsh
run: | run: |
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
$version = ((Get-Content "src/core/constants.py" -Raw) -match '__version__\s*=\s*"([^"]+)"') > $null; $Matches[1] $content = Get-Content "src/core/constants.py" -Raw
if (-not $version) { throw "Could not read version" } $m = [regex]::Match($content, '__version__\s*=\s*"([^"]+)"')
if (-not $m.Success) { throw "Could not read version from src/core/constants.py" }
$version = $m.Groups[1].Value
New-Item -ItemType Directory -Path "release-assets" -Force | Out-Null New-Item -ItemType Directory -Path "release-assets" -Force | Out-Null
$staging = "release-staging" $staging = "release-staging"
Remove-Item -Recurse -Force $staging -ErrorAction SilentlyContinue Remove-Item -Recurse -Force $staging -ErrorAction SilentlyContinue
@@ -131,7 +136,18 @@ jobs:
done done
archive="MasterHttpRelayVPN-${version}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz" archive="MasterHttpRelayVPN-${version}-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz"
tar -C release-staging -czf "release-assets/$archive" . tar -C release-staging -czf "release-assets/$archive" .
sha256sum "release-assets/$archive" | awk '{print $1 " " FILENAME}' FILENAME="$archive" > "release-assets/$archive.sha256" ARCHIVE_NAME="$archive" python - <<'PY'
import hashlib
import os
from pathlib import Path
archive = Path("release-assets") / os.environ["ARCHIVE_NAME"]
digest = hashlib.sha256(archive.read_bytes()).hexdigest()
(archive.parent / f"{archive.name}.sha256").write_text(
f"{digest} {archive.name}\n",
encoding="utf-8",
)
PY
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@@ -148,6 +164,9 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up QEMU for cross-arch containers
uses: docker/setup-qemu-action@v3
- name: Build Termux binaries (arm64 + armv7) - name: Build Termux binaries (arm64 + armv7)
shell: bash shell: bash
run: | run: |
@@ -177,6 +196,7 @@ jobs:
"$image" \ "$image" \
bash -lc ' bash -lc '
set -euo pipefail set -euo pipefail
echo "Building Termux binary for ${arch}"
pkg update -y pkg update -y
pkg install -y python clang make pkg-config libffi openssl rust binutils pkg install -y python clang make pkg-config libffi openssl rust binutils
python -m pip install --upgrade pip python -m pip install --upgrade pip
@@ -216,7 +236,16 @@ jobs:
archive="MasterHttpRelayVPN-${version}-termux-${arch}.zip" archive="MasterHttpRelayVPN-${version}-termux-${arch}.zip"
(cd "$staging" && zip -qr "../release-assets/${archive}" .) (cd "$staging" && zip -qr "../release-assets/${archive}" .)
sha256sum "release-assets/${archive}" | awk '{print $1 " " FILENAME}' FILENAME="$archive" > "release-assets/${archive}.sha256" python - <<PY
import hashlib
from pathlib import Path
archive = Path("release-assets") / "${archive}"
digest = hashlib.sha256(archive.read_bytes()).hexdigest()
(archive.parent / f"{archive.name}.sha256").write_text(
f"{digest} {archive.name}\\n",
encoding="utf-8",
)
PY
done done
- name: Upload build artifacts - name: Upload build artifacts