Cannot find path
This commit is contained in:
1 file changed
+153
-38
+153
-38
@@ -25,16 +25,38 @@ jobs:
|
|||||||
runs-on: rustdesk-windows
|
runs-on: rustdesk-windows
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Clone Fluxer
|
||||||
uses: actions/checkout@v4
|
shell: powershell
|
||||||
with:
|
run: |
|
||||||
fetch-depth: 1
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
if (Test-Path "fluxer-src") {
|
||||||
|
Remove-Item "fluxer-src" -Recurse -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
git clone `
|
||||||
|
--depth 1 `
|
||||||
|
--branch main `
|
||||||
|
https://github.com/fluxerapp/fluxer.git `
|
||||||
|
fluxer-src
|
||||||
|
|
||||||
|
if (-not (Test-Path "fluxer-src\fluxer_desktop\src\common\Constants.ts")) {
|
||||||
|
throw "Fluxer source tree is invalid: Constants.ts not found"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Fluxer revision:"
|
||||||
|
git -C fluxer-src rev-parse HEAD
|
||||||
|
|
||||||
|
Write-Host "Desktop directory:"
|
||||||
|
Get-ChildItem "fluxer-src\fluxer_desktop"
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: "24"
|
||||||
|
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
@@ -46,6 +68,7 @@ jobs:
|
|||||||
node --version
|
node --version
|
||||||
pnpm --version
|
pnpm --version
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
@@ -58,6 +81,7 @@ jobs:
|
|||||||
rustc --version
|
rustc --version
|
||||||
cargo --version
|
cargo --version
|
||||||
|
|
||||||
|
|
||||||
- name: Show build tools
|
- name: Show build tools
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
@@ -87,24 +111,27 @@ jobs:
|
|||||||
Write-Host "NASM:"
|
Write-Host "NASM:"
|
||||||
nasm --version
|
nasm --version
|
||||||
|
|
||||||
|
|
||||||
- name: Configure self-hosted server
|
- name: Configure self-hosted server
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
$Path = "fluxer_desktop/src/common/Constants.ts"
|
$Path = "fluxer-src\fluxer_desktop\src\common\Constants.ts"
|
||||||
|
|
||||||
|
if (-not (Test-Path $Path)) {
|
||||||
|
throw "Constants.ts not found at $Path"
|
||||||
|
}
|
||||||
|
|
||||||
$Content = Get-Content $Path -Raw
|
$Content = Get-Content $Path -Raw
|
||||||
|
|
||||||
$Content = $Content.Replace(
|
$Content = $Content -replace `
|
||||||
"export const STABLE_APP_URL = 'https://web.fluxer.app';",
|
"export const STABLE_APP_URL = '[^']+';", `
|
||||||
"export const STABLE_APP_URL = 'https://ds.gandc.ru';"
|
"export const STABLE_APP_URL = 'https://ds.gandc.ru';"
|
||||||
)
|
|
||||||
|
|
||||||
$Content = $Content.Replace(
|
$Content = $Content -replace `
|
||||||
"export const CANARY_APP_URL = 'https://web.canary.fluxer.app';",
|
"export const CANARY_APP_URL = '[^']+';", `
|
||||||
"export const CANARY_APP_URL = 'https://ds.gandc.ru';"
|
"export const CANARY_APP_URL = 'https://ds.gandc.ru';"
|
||||||
)
|
|
||||||
|
|
||||||
Set-Content `
|
Set-Content `
|
||||||
-Path $Path `
|
-Path $Path `
|
||||||
@@ -112,23 +139,30 @@ jobs:
|
|||||||
-NoNewline `
|
-NoNewline `
|
||||||
-Encoding utf8
|
-Encoding utf8
|
||||||
|
|
||||||
|
Write-Host "Result:"
|
||||||
Get-Content $Path
|
Get-Content $Path
|
||||||
|
|
||||||
if ((Get-Content $Path -Raw) -match "web\.fluxer\.app") {
|
$Result = Get-Content $Path -Raw
|
||||||
throw "STABLE_APP_URL was not replaced"
|
|
||||||
|
if ($Result -notmatch "STABLE_APP_URL = 'https://ds\.gandc\.ru'") {
|
||||||
|
throw "STABLE_APP_URL was not configured"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Get-Content $Path -Raw) -match "web\.canary\.fluxer\.app") {
|
if ($Result -notmatch "CANARY_APP_URL = 'https://ds\.gandc\.ru'") {
|
||||||
throw "CANARY_APP_URL was not replaced"
|
throw "CANARY_APP_URL was not configured"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
Set-Location fluxer-src
|
||||||
|
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|
||||||
- name: Build Fluxer Desktop
|
- name: Build Fluxer Desktop
|
||||||
shell: powershell
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
@@ -136,8 +170,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
Set-Location fluxer-src
|
||||||
|
|
||||||
pnpm --filter fluxer_desktop build
|
pnpm --filter fluxer_desktop build
|
||||||
|
|
||||||
|
|
||||||
- name: Package Windows portable
|
- name: Package Windows portable
|
||||||
shell: powershell
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
@@ -146,7 +183,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
Set-Location fluxer_desktop
|
Set-Location fluxer-src\fluxer_desktop
|
||||||
|
|
||||||
pnpm exec electron-builder `
|
pnpm exec electron-builder `
|
||||||
--config electron-builder.config.cjs `
|
--config electron-builder.config.cjs `
|
||||||
@@ -154,22 +191,24 @@ jobs:
|
|||||||
--x64 `
|
--x64 `
|
||||||
--publish never
|
--publish never
|
||||||
|
|
||||||
|
|
||||||
- name: Show Windows artifacts
|
- name: Show Windows artifacts
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
Get-ChildItem `
|
Get-ChildItem `
|
||||||
-Path "fluxer_desktop/dist-electron" `
|
-Path "fluxer-src\fluxer_desktop\dist-electron" `
|
||||||
-Recurse |
|
-Recurse |
|
||||||
Select-Object FullName, Length
|
Select-Object FullName, Length
|
||||||
|
|
||||||
|
|
||||||
- name: Upload Windows artifact
|
- name: Upload Windows artifact
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: fluxer-windows-x64
|
name: fluxer-windows-x64
|
||||||
path: |
|
path: |
|
||||||
fluxer_desktop/dist-electron/*.exe
|
fluxer-src/fluxer_desktop/dist-electron/*.exe
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|
||||||
@@ -179,10 +218,28 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Clone Fluxer
|
||||||
uses: actions/checkout@v4
|
shell: bash
|
||||||
with:
|
run: |
|
||||||
fetch-depth: 1
|
set -euxo pipefail
|
||||||
|
|
||||||
|
rm -rf fluxer-src
|
||||||
|
|
||||||
|
git clone \
|
||||||
|
--depth 1 \
|
||||||
|
--branch main \
|
||||||
|
https://github.com/fluxerapp/fluxer.git \
|
||||||
|
fluxer-src
|
||||||
|
|
||||||
|
test -f \
|
||||||
|
fluxer-src/fluxer_desktop/src/common/Constants.ts
|
||||||
|
|
||||||
|
echo "Fluxer revision:"
|
||||||
|
git -C fluxer-src rev-parse HEAD
|
||||||
|
|
||||||
|
echo "Desktop directory:"
|
||||||
|
ls -la fluxer-src/fluxer_desktop
|
||||||
|
|
||||||
|
|
||||||
- name: Install Linux build dependencies
|
- name: Install Linux build dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -252,11 +309,13 @@ jobs:
|
|||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
zstd
|
zstd
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: "24"
|
||||||
|
|
||||||
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -268,6 +327,7 @@ jobs:
|
|||||||
node --version
|
node --version
|
||||||
pnpm --version
|
pnpm --version
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -288,6 +348,7 @@ jobs:
|
|||||||
"$HOME/.cargo/bin/rustc" --version
|
"$HOME/.cargo/bin/rustc" --version
|
||||||
"$HOME/.cargo/bin/cargo" --version
|
"$HOME/.cargo/bin/cargo" --version
|
||||||
|
|
||||||
|
|
||||||
- name: Configure self-hosted server
|
- name: Configure self-hosted server
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -295,38 +356,86 @@ jobs:
|
|||||||
|
|
||||||
python3 <<'PY'
|
python3 <<'PY'
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
|
||||||
path = Path("fluxer_desktop/src/common/Constants.ts")
|
path = Path(
|
||||||
data = path.read_text(encoding="utf-8")
|
"fluxer-src/fluxer_desktop/src/common/Constants.ts"
|
||||||
|
)
|
||||||
|
|
||||||
data = data.replace(
|
if not path.is_file():
|
||||||
"export const STABLE_APP_URL = 'https://web.fluxer.app';",
|
raise SystemExit(
|
||||||
|
f"Constants.ts not found: {path}"
|
||||||
|
)
|
||||||
|
|
||||||
|
data = path.read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
|
|
||||||
|
data, stable_count = re.subn(
|
||||||
|
r"export const STABLE_APP_URL = '[^']+';",
|
||||||
"export const STABLE_APP_URL = 'https://ds.gandc.ru';",
|
"export const STABLE_APP_URL = 'https://ds.gandc.ru';",
|
||||||
|
data,
|
||||||
|
count=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
data = data.replace(
|
data, canary_count = re.subn(
|
||||||
"export const CANARY_APP_URL = 'https://web.canary.fluxer.app';",
|
r"export const CANARY_APP_URL = '[^']+';",
|
||||||
"export const CANARY_APP_URL = 'https://ds.gandc.ru';",
|
"export const CANARY_APP_URL = 'https://ds.gandc.ru';",
|
||||||
|
data,
|
||||||
|
count=1,
|
||||||
)
|
)
|
||||||
|
|
||||||
path.write_text(data, encoding="utf-8")
|
if stable_count != 1:
|
||||||
|
raise SystemExit(
|
||||||
|
"Unable to patch STABLE_APP_URL"
|
||||||
|
)
|
||||||
|
|
||||||
if "https://web.fluxer.app" in data:
|
if canary_count != 1:
|
||||||
raise SystemExit("STABLE_APP_URL was not replaced")
|
raise SystemExit(
|
||||||
|
"Unable to patch CANARY_APP_URL"
|
||||||
|
)
|
||||||
|
|
||||||
if "https://web.canary.fluxer.app" in data:
|
path.write_text(
|
||||||
raise SystemExit("CANARY_APP_URL was not replaced")
|
data,
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
|
|
||||||
print(data)
|
result = path.read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (
|
||||||
|
"export const STABLE_APP_URL = "
|
||||||
|
"'https://ds.gandc.ru';"
|
||||||
|
not in result
|
||||||
|
):
|
||||||
|
raise SystemExit(
|
||||||
|
"STABLE_APP_URL verification failed"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (
|
||||||
|
"export const CANARY_APP_URL = "
|
||||||
|
"'https://ds.gandc.ru';"
|
||||||
|
not in result
|
||||||
|
):
|
||||||
|
raise SystemExit(
|
||||||
|
"CANARY_APP_URL verification failed"
|
||||||
|
)
|
||||||
|
|
||||||
|
print(result)
|
||||||
PY
|
PY
|
||||||
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
|
cd fluxer-src
|
||||||
|
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
|
||||||
- name: Build Fluxer Desktop
|
- name: Build Fluxer Desktop
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
@@ -334,8 +443,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
|
cd fluxer-src
|
||||||
|
|
||||||
pnpm --filter fluxer_desktop build
|
pnpm --filter fluxer_desktop build
|
||||||
|
|
||||||
|
|
||||||
- name: Package Linux
|
- name: Package Linux
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
@@ -344,7 +456,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
cd fluxer_desktop
|
cd fluxer-src/fluxer_desktop
|
||||||
|
|
||||||
pnpm exec electron-builder \
|
pnpm exec electron-builder \
|
||||||
--config electron-builder.config.cjs \
|
--config electron-builder.config.cjs \
|
||||||
@@ -352,22 +464,25 @@ jobs:
|
|||||||
--x64 \
|
--x64 \
|
||||||
--publish never
|
--publish never
|
||||||
|
|
||||||
|
|
||||||
- name: Show Linux artifacts
|
- name: Show Linux artifacts
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
find fluxer_desktop/dist-electron \
|
find \
|
||||||
|
fluxer-src/fluxer_desktop/dist-electron \
|
||||||
-maxdepth 2 \
|
-maxdepth 2 \
|
||||||
-type f \
|
-type f \
|
||||||
-printf '%p %s bytes\n' |
|
-printf '%p %s bytes\n' |
|
||||||
sort
|
sort
|
||||||
|
|
||||||
|
|
||||||
- name: Upload Linux artifacts
|
- name: Upload Linux artifacts
|
||||||
uses: actions/upload-artifact@v4.6.2
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: fluxer-linux-x64
|
name: fluxer-linux-x64
|
||||||
path: |
|
path: |
|
||||||
fluxer_desktop/dist-electron/*.AppImage
|
fluxer-src/fluxer_desktop/dist-electron/*.AppImage
|
||||||
fluxer_desktop/dist-electron/*.deb
|
fluxer-src/fluxer_desktop/dist-electron/*.deb
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
Reference in new issue
Block a user