343 lines
10 KiB
YAML
343 lines
10 KiB
YAML
name: Build Fluxer Desktop
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
NODE_VERSION: "26"
|
|
BUILD_CHANNEL: "stable"
|
|
NODE_ENV: "production"
|
|
FLUXER_DESKTOP_PRODUCTION: "true"
|
|
# Bundle the renderer; Gitea releases do not provide Fluxer module manifests.
|
|
FLUXER_MODULES: "0"
|
|
FLUXER_OFFLINE: "0"
|
|
VERSION: "1.0.${{ gitea.run_number }}"
|
|
BUILD_VERSION: "1.0.${{ gitea.run_number }}"
|
|
PUBLIC_BUILD_VERSION: "1.0.${{ gitea.run_number }}"
|
|
PUBLIC_RELEASE_CHANNEL: "stable"
|
|
|
|
jobs:
|
|
shared-renderer:
|
|
name: Shared renderer and upstream revision
|
|
runs-on: ci-linux-builder
|
|
outputs:
|
|
sha: ${{ steps.source.outputs.sha }}
|
|
env:
|
|
NEXUS_CARGO_URL: ${{ secrets.NEXUS_CARGO_URL }}
|
|
NEXUS_MAVEN_URL: ${{ secrets.NEXUS_MAVEN_URL }}
|
|
NEXUS_NPM_URL: ${{ secrets.NEXUS_NPM_URL }}
|
|
NEXUS_NODEJS_URL: ${{ secrets.NEXUS_NODEJS_URL }}
|
|
steps:
|
|
- name: Checkout CI repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare RAM CI environment
|
|
uses: ./.gitea/actions/prepare-ram-ci
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Clone current upstream main
|
|
id: source
|
|
shell: bash
|
|
run: node scripts/prepare-upstream.mjs
|
|
|
|
- name: Apply GSCORD patches
|
|
shell: bash
|
|
run: node scripts/apply-patches.mjs fluxer-src
|
|
|
|
- name: Setup pnpm from upstream packageManager
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
package_json_file: fluxer-src/package.json
|
|
run_install: false
|
|
|
|
- name: Prepare renderer WASM toolchain
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
rustup update stable
|
|
rustup target add wasm32-unknown-unknown --toolchain stable
|
|
rustc --version
|
|
clang --version
|
|
llvm-ar --version
|
|
|
|
- name: Install dependencies including build tools
|
|
shell: bash
|
|
working-directory: fluxer-src
|
|
run: pnpm install --frozen-lockfile --prod=false
|
|
|
|
- name: Check GSCORD behavior
|
|
shell: bash
|
|
run: node --test scripts/customizations.test.mjs
|
|
|
|
- name: Build shared renderer
|
|
shell: bash
|
|
working-directory: fluxer-src
|
|
run: pnpm --filter fluxer_desktop build --shared-assets
|
|
|
|
- name: Archive renderer
|
|
shell: bash
|
|
run: tar -C fluxer-src/fluxer_desktop/dist -czf renderer.tar.gz renderer
|
|
|
|
- name: Upload renderer
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: gscord-shared-renderer
|
|
path: renderer.tar.gz
|
|
if-no-files-found: error
|
|
|
|
windows-x64:
|
|
name: Windows x64
|
|
needs: shared-renderer
|
|
runs-on: rustdesk-windows
|
|
env:
|
|
UPSTREAM_SHA: ${{ needs.shared-renderer.outputs.sha }}
|
|
steps:
|
|
- name: Checkout CI repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Clone selected upstream revision
|
|
shell: powershell
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
node scripts/prepare-upstream.mjs
|
|
if ($LASTEXITCODE -ne 0) { throw "Upstream checkout failed" }
|
|
|
|
- name: Apply GSCORD patches
|
|
shell: powershell
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
node scripts/apply-patches.mjs fluxer-src
|
|
if ($LASTEXITCODE -ne 0) { throw "Patch application failed" }
|
|
|
|
- name: Setup pnpm from upstream packageManager
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
package_json_file: fluxer-src/package.json
|
|
run_install: false
|
|
|
|
- name: Setup Rust
|
|
shell: powershell
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
rustup update stable
|
|
if ($LASTEXITCODE -ne 0) { throw "Rust update failed" }
|
|
rustup default stable
|
|
if ($LASTEXITCODE -ne 0) { throw "Rust selection failed" }
|
|
rustup target add x86_64-pc-windows-msvc
|
|
if ($LASTEXITCODE -ne 0) { throw "Rust target installation failed" }
|
|
|
|
- name: Show build tools
|
|
shell: powershell
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
foreach ($Tool in @("node", "pnpm", "rustc", "cargo", "cmake", "ninja", "clang", "nasm")) {
|
|
& $Tool --version
|
|
if ($LASTEXITCODE -ne 0) { throw "Build tool check failed: $Tool" }
|
|
}
|
|
|
|
- name: Install dependencies including build tools
|
|
shell: powershell
|
|
working-directory: fluxer-src
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
pnpm install --frozen-lockfile --prod=false
|
|
if ($LASTEXITCODE -ne 0) { throw "Dependency installation failed" }
|
|
|
|
- name: Download renderer
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: gscord-shared-renderer
|
|
path: shared-renderer
|
|
|
|
- name: Extract renderer
|
|
shell: powershell
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
New-Item -ItemType Directory -Force fluxer-src/fluxer_desktop/dist | Out-Null
|
|
tar -xzf shared-renderer/renderer.tar.gz -C fluxer-src/fluxer_desktop/dist
|
|
if ($LASTEXITCODE -ne 0) { throw "Renderer extraction failed" }
|
|
|
|
- name: Build Fluxer Desktop
|
|
shell: powershell
|
|
working-directory: fluxer-src
|
|
env:
|
|
ELECTRON_ARCH: x64
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
pnpm --filter fluxer_desktop build --use-shared-renderer
|
|
if ($LASTEXITCODE -ne 0) { throw "Desktop build failed" }
|
|
|
|
- name: Package Windows portable
|
|
shell: powershell
|
|
working-directory: fluxer-src/fluxer_desktop
|
|
env:
|
|
ELECTRON_ARCH: x64
|
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
|
run: |
|
|
$ErrorActionPreference = "Stop"
|
|
pnpm exec electron-builder --config electron-builder.config.cjs --win portable --x64 --publish never
|
|
if ($LASTEXITCODE -ne 0) { throw "Windows packaging failed" }
|
|
|
|
- name: Upload Windows artifact
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: fluxer-windows-x64
|
|
path: fluxer-src/fluxer_desktop/dist-electron/*.exe
|
|
if-no-files-found: error
|
|
|
|
linux-x64:
|
|
name: Linux x64
|
|
needs: shared-renderer
|
|
runs-on: ci-linux-builder
|
|
env:
|
|
UPSTREAM_SHA: ${{ needs.shared-renderer.outputs.sha }}
|
|
NEXUS_CARGO_URL: ${{ secrets.NEXUS_CARGO_URL }}
|
|
NEXUS_MAVEN_URL: ${{ secrets.NEXUS_MAVEN_URL }}
|
|
NEXUS_NPM_URL: ${{ secrets.NEXUS_NPM_URL }}
|
|
NEXUS_NODEJS_URL: ${{ secrets.NEXUS_NODEJS_URL }}
|
|
steps:
|
|
- name: Checkout CI repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare RAM CI environment
|
|
uses: ./.gitea/actions/prepare-ram-ci
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Clone selected upstream revision
|
|
shell: bash
|
|
run: node scripts/prepare-upstream.mjs
|
|
|
|
- name: Apply GSCORD patches
|
|
shell: bash
|
|
run: node scripts/apply-patches.mjs fluxer-src
|
|
|
|
- name: Setup pnpm from upstream packageManager
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
package_json_file: fluxer-src/package.json
|
|
run_install: false
|
|
|
|
- name: Verify builder image and update Rust
|
|
shell: bash
|
|
env:
|
|
PKG_CONFIG_PATH: /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig
|
|
run: |
|
|
set -euo pipefail
|
|
rustup update stable
|
|
node --version
|
|
pnpm --version
|
|
rustc --version
|
|
cargo --version
|
|
cmake --version
|
|
meson --version
|
|
ninja --version
|
|
clang --version
|
|
pkg-config --atleast-version=1.17.0 libfido2
|
|
pkg-config --atleast-version=1.0.5 libpipewire-0.3
|
|
pkg-config --modversion libfido2 libpipewire-0.3 libspa-0.2
|
|
test -f /usr/local/include/fido/es384.h
|
|
|
|
- name: Install dependencies including build tools
|
|
shell: bash
|
|
working-directory: fluxer-src
|
|
run: pnpm install --frozen-lockfile --prod=false
|
|
|
|
- name: Download renderer
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: gscord-shared-renderer
|
|
path: shared-renderer
|
|
|
|
- name: Extract renderer
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p fluxer-src/fluxer_desktop/dist
|
|
tar -xzf shared-renderer/renderer.tar.gz -C fluxer-src/fluxer_desktop/dist
|
|
|
|
- name: Build Fluxer Desktop
|
|
shell: bash
|
|
working-directory: fluxer-src
|
|
env:
|
|
ELECTRON_ARCH: x64
|
|
PKG_CONFIG_PATH: /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig
|
|
LD_LIBRARY_PATH: /usr/local/lib/x86_64-linux-gnu:/usr/local/lib
|
|
run: pnpm --filter fluxer_desktop build --use-shared-renderer
|
|
|
|
- name: Inspect Linux native libraries
|
|
shell: bash
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
cd fluxer-src
|
|
|
|
echo "Searching for WebAuthn native module..."
|
|
|
|
find fluxer_desktop \
|
|
-type f \
|
|
\( -name '*.node' -o -name 'libfido2.so*' \) \
|
|
-print
|
|
|
|
echo "Dynamic dependencies:"
|
|
|
|
while IFS= read -r file; do
|
|
echo "===== $file ====="
|
|
ldd "$file" || true
|
|
done < <(
|
|
find fluxer_desktop \
|
|
-type f \
|
|
-name '*.node'
|
|
)
|
|
|
|
- name: Package Linux
|
|
shell: bash
|
|
env:
|
|
ELECTRON_ARCH: x64
|
|
CSC_IDENTITY_AUTO_DISCOVERY: "false"
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
cd fluxer-src/fluxer_desktop
|
|
|
|
pnpm exec electron-builder \
|
|
--config electron-builder.config.cjs \
|
|
--linux AppImage deb \
|
|
--x64 \
|
|
--publish never
|
|
|
|
|
|
- name: Show Linux artifacts
|
|
shell: bash
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
find \
|
|
fluxer-src/fluxer_desktop/dist-electron \
|
|
-maxdepth 2 \
|
|
-type f \
|
|
-printf '%p %s bytes\n' |
|
|
sort
|
|
|
|
|
|
- name: Upload Linux artifacts
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: fluxer-linux-x64
|
|
path: |
|
|
fluxer-src/fluxer_desktop/dist-electron/*.AppImage
|
|
fluxer-src/fluxer_desktop/dist-electron/*.deb
|
|
if-no-files-found: error
|