fix path
Build Fluxer Desktop / Linux x64 (push) Failing after 3m39s
Build Fluxer Desktop / Windows x64 (push) Canceled after 6m32s

This commit is contained in:
gandc committed 2026-09-17 00:53:56 +03:00
1 parent 2c0b5286a7
commit c901908eab
1 file changed
+142 -63
+142 -63
View File
@@ -223,51 +223,84 @@ jobs:
run: | run: |
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
Set-Location fluxer-src Set-Location "fluxer-src\fluxer_desktop"
$PnpmRoot = "node_modules\.pnpm" $LiveKitPath = Join-Path `
(Get-Location) `
"node_modules\livekit-client"
if (-not (Test-Path $PnpmRoot)) { if (-not (Test-Path $LiveKitPath)) {
throw "pnpm node_modules directory not found" $Entry = (
node -e "process.stdout.write(require.resolve('livekit-client'))"
).Trim()
if (-not $Entry) {
throw "Unable to resolve livekit-client"
} }
$LiveKitPackages = Get-ChildItem ` $Dir = Split-Path $Entry -Parent
-Path $PnpmRoot `
-Directory ` while ($Dir) {
-Filter "livekit-client@*" | $PackageJson = Join-Path $Dir "package.json"
ForEach-Object {
Join-Path $_.FullName "node_modules\livekit-client" if (Test-Path $PackageJson) {
} | $PackageInfo = Get-Content `
Where-Object { $PackageJson `
Test-Path $_ -Raw |
ConvertFrom-Json
if ($PackageInfo.name -eq "livekit-client") {
$LiveKitPath = $Dir
break
}
} }
if (-not $LiveKitPackages) { $Parent = Split-Path $Dir -Parent
throw "livekit-client package not found"
if (
-not $Parent -or
$Parent -eq $Dir
) {
break
}
$Dir = $Parent
}
}
if (-not (Test-Path $LiveKitPath)) {
throw "livekit-client package directory not found"
}
$LiveKitPath = (
Resolve-Path $LiveKitPath
).Path
Write-Host "LiveKit package: $LiveKitPath"
$PackageJson = Join-Path `
$LiveKitPath `
"package.json"
if (Test-Path $PackageJson) {
$PackageInfo = Get-Content `
$PackageJson `
-Raw |
ConvertFrom-Json
Write-Host `
"livekit-client version: $($PackageInfo.version)"
} }
$Pattern = "(iceTransportPolicy\s*=\s*['""])(relay)(['""])" $Pattern = "(iceTransportPolicy\s*=\s*['""])(relay)(['""])"
$TotalReplacements = 0 $TotalReplacements = 0
foreach ($PackagePath in $LiveKitPackages) {
Write-Host "Patching LiveKit package: $PackagePath"
$PackageJson = Join-Path $PackagePath "package.json"
if (Test-Path $PackageJson) {
$PackageInfo = Get-Content $PackageJson -Raw |
ConvertFrom-Json
Write-Host "livekit-client version: $($PackageInfo.version)"
}
$Files = Get-ChildItem ` $Files = Get-ChildItem `
-Path $PackagePath ` -Path $LiveKitPath `
-Recurse ` -Recurse `
-File | -File |
Where-Object { Where-Object {
$_.Extension -in @( $_.Extension -in @(
".ts",
".js", ".js",
".mjs", ".mjs",
".cjs" ".cjs"
@@ -275,7 +308,10 @@ jobs:
} }
foreach ($File in $Files) { foreach ($File in $Files) {
$Content = Get-Content $File.FullName -Raw $Content = Get-Content `
$File.FullName `
-Raw
$Count = [regex]::Matches( $Count = [regex]::Matches(
$Content, $Content,
$Pattern $Pattern
@@ -302,7 +338,6 @@ jobs:
Write-Host ` Write-Host `
"Patched $Count occurrence(s): $($File.FullName)" "Patched $Count occurrence(s): $($File.FullName)"
} }
}
if ($TotalReplacements -lt 1) { if ($TotalReplacements -lt 1) {
throw "LiveKit relay ICE policy assignment was not found" throw "LiveKit relay ICE policy assignment was not found"
@@ -799,46 +834,83 @@ jobs:
run: | run: |
set -euxo pipefail set -euxo pipefail
cd fluxer-src cd fluxer-src/fluxer_desktop
LIVEKIT_DIR="node_modules/livekit-client"
if [ ! -d "${LIVEKIT_DIR}" ]; then
LIVEKIT_ENTRY="$(
node -e \
"process.stdout.write(require.resolve('livekit-client'))"
)"
export LIVEKIT_ENTRY
LIVEKIT_DIR="$(
python3 <<'PY'
from pathlib import Path
import json
import os
entry = Path(
os.environ["LIVEKIT_ENTRY"]
).resolve()
for directory in [
entry.parent,
*entry.parents,
]:
package_json = (
directory / "package.json"
)
if not package_json.is_file():
continue
try:
package = json.loads(
package_json.read_text(
encoding="utf-8"
)
)
except Exception:
continue
if (
package.get("name")
== "livekit-client"
):
print(directory)
break
else:
raise SystemExit(
"Unable to locate "
"livekit-client package directory"
)
PY
)"
fi
LIVEKIT_DIR="$(
readlink -f "${LIVEKIT_DIR}"
)"
test -d "${LIVEKIT_DIR}"
export LIVEKIT_DIR
python3 <<'PY' python3 <<'PY'
from pathlib import Path from pathlib import Path
import json import json
import os
import re import re
pnpm_root = Path("node_modules/.pnpm") package = Path(
os.environ["LIVEKIT_DIR"]
if not pnpm_root.is_dir():
raise SystemExit(
"pnpm node_modules directory not found"
) )
packages = sorted(
path / "node_modules/livekit-client"
for path in pnpm_root.glob(
"livekit-client@*"
)
if (
path / "node_modules/livekit-client"
).is_dir()
)
if not packages:
raise SystemExit(
"livekit-client package not found"
)
pattern = re.compile(
r"(iceTransportPolicy\s*=\s*['\"])"
r"relay"
r"(['\"])"
)
total_replacements = 0
for package in packages:
print( print(
f"Patching LiveKit package: {package}" f"LiveKit package: {package}"
) )
package_json = ( package_json = (
@@ -860,12 +932,19 @@ jobs:
), ),
) )
pattern = re.compile(
r"(iceTransportPolicy\s*=\s*['\"])"
r"relay"
r"(['\"])"
)
total_replacements = 0
for path in package.rglob("*"): for path in package.rglob("*"):
if ( if (
not path.is_file() not path.is_file()
or path.suffix or path.suffix
not in { not in {
".ts",
".js", ".js",
".mjs", ".mjs",
".cjs", ".cjs",