Remove Electron and make Rust Slint the sole native client

This commit is contained in:
bit9992 committed 2026-11-10 17:53:53 +03:00
1 parent eb24965076
commit 220852f8cb
720 files changed
+2535 -130856

No files matched your search

+106 -184
View File
@@ -1,8 +1,7 @@
# Release builds on the self-hosted Gitea runner (Linux x64 job containers).
# - workflow_dispatch: build + verify packages, keep them as run artifacts (no release).
# - tag v*: same, then publish a Gitea release with the packages, only if every build job succeeded.
# Windows x64 packages are built on a Windows machine and attached separately (see README).
name: release
# Trusted tag pushes publish only after both native architectures and release assembly pass.
# Manual dispatch builds/verifies and retains artifacts without publication.
# These labels require preprovisioned matching-ISA native runners (no emulated acceptance).
name: native-release
on:
push:
@@ -17,215 +16,138 @@ defaults:
shell: bash
jobs:
linux-x64:
runs-on: ubuntu-latest
container:
image: node:22-bookworm
native-linux:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: teamspeach-native-linux-x64
- target: aarch64-unknown-linux-gnu
runner: teamspeach-native-linux-arm64
runs-on: ${{ matrix.runner }}
env:
CARGO_TERM_COLOR: never
CARGO_BUILD_JOBS: "2"
TARGET: ${{ matrix.target }}
LLVM_HOME: ${{ vars.NATIVE_LLVM_HOME }}
SKIA_SOURCE_DIR: ${{ vars.NATIVE_SKIA_SOURCE_DIR }}
LIBCLANG_PATH: ${{ vars.NATIVE_LIBCLANG_PATH }}
LK_CUSTOM_WEBRTC: ${{ github.workspace }}/target/native-deps/${{ matrix.target }}/webrtc
steps:
- uses: actions/checkout@v4
- name: Version gate (tag = package.json = core/Cargo.toml)
run: node scripts/check-version.mjs
- name: System packages (container only)
- name: Require explicit native source/tool provisioning
run: |
set -euo pipefail
apt-get update
apt-get install -y --no-install-recommends build-essential cmake curl ca-certificates git \
xvfb xauth libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libgbm1 libgtk-3-0 \
libasound2 libxss1 libxshmfence1 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libpango-1.0-0
: "${LLVM_HOME:?set NATIVE_LLVM_HOME to installed LLVM}"
: "${LIBCLANG_PATH:?set NATIVE_LIBCLANG_PATH to the libclang directory}"
: "${SKIA_SOURCE_DIR:?set NATIVE_SKIA_SOURCE_DIR to a dependency-synchronized Skia checkout}"
test -x "$LLVM_HOME/bin/clang"
test -f "$SKIA_SOURCE_DIR/BUILD.gn"
test -x "$SKIA_SOURCE_DIR/bin/gn"
echo "$LLVM_HOME/bin" >> "$GITHUB_PATH"
for tool in cargo cmake ninja python3 xvfb-run dbus-run-session linuxdeploy appimagetool unsquashfs llvm-readelf; do
command -v "$tool"
done
echo "SKIA_GN_COMMAND=$SKIA_SOURCE_DIR/bin/gn" >> "$GITHUB_ENV"
echo "SKIA_NINJA_COMMAND=$(command -v ninja)" >> "$GITHUB_ENV"
- name: Rust toolchain
- name: Tag must match native workspace version
run: cargo run --locked -p xtask -- check-version
- name: Provision pinned WebRTC sources and archive
run: cargo run --locked -p xtask -- deps --target "$TARGET" --llvm-dir "$LLVM_HOME" --jobs "$CARGO_BUILD_JOBS"
- name: Rust workspace tests on matching native architecture
run: cargo test --locked --workspace --target "$TARGET" --jobs "$CARGO_BUILD_JOBS"
- name: Build explicit native smoke harness with default Skia and WebRTC
run: cargo run --locked -p xtask -- build --target "$TARGET" --llvm-dir "$LLVM_HOME" --skia-source "$SKIA_SOURCE_DIR" --jobs "$CARGO_BUILD_JOBS" --test-harness true
- name: Native offline UI and historical profile migration smoke
run: |
set -euo pipefail
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.96.0 --target wasm32-unknown-unknown
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
dbus-run-session -- xvfb-run -a cargo run --locked -p xtask -- smoke --target "$TARGET" --scenario offline-ui --out "native-smoke-$TARGET"
dbus-run-session -- xvfb-run -a cargo run --locked -p xtask -- smoke --target "$TARGET" --scenario migration --out "native-migration-$TARGET"
- name: Tests
- name: Rebuild production native app and update helper (no test harness)
run: cargo run --locked -p xtask -- build --target "$TARGET" --llvm-dir "$LLVM_HOME" --skia-source "$SKIA_SOURCE_DIR" --jobs "$CARGO_BUILD_JOBS"
- name: Package and inspect real native archive payloads
run: |
set -euo pipefail
npm ci
node scripts/build-denoise.mjs
cargo test --manifest-path dsp/Cargo.toml --locked
npm test
cargo test --manifest-path core/Cargo.toml --locked
cargo run --locked -p xtask -- package --target "$TARGET" --out dist/native
cargo run --locked -p xtask -- verify-package --target "$TARGET" --out dist/native
cp native/native-deps.lock.json "dist/native/$TARGET/native-deps.lock.json"
- name: Core release build and checks
run: |
set -euo pipefail
cargo build --manifest-path core/Cargo.toml --release --locked
node scripts/binary-arch.mjs "${CARGO_TARGET_DIR:-target}/release/teamspeach-core" --expect linux-x64
node scripts/core-smoke.mjs "${CARGO_TARGET_DIR:-target}/release/teamspeach-core"
- name: Electron UI smoke (Xvfb, offline)
env:
TEAMSPEACH_SMOKE_EXTRA_ARGS: --no-sandbox
run: xvfb-run -a node scripts/smoke-ui.mjs --out smoke-out
- name: Updater engine behaviour (Xvfb, real electron-updater, emulated release server)
run: xvfb-run -a node --test test/update-engine.test.mjs
- name: Package
run: node scripts/dist.mjs --os linux --arch x64
- name: Update feed matches the packages (name, size, sha512, version)
run: node scripts/update-feed-check.mjs --version "$(node -p "require('./package.json').version")" dist/*-linux.yml
- name: Package report (ELF layout of every packaged binary incl. the AppImage runtime)
run: |
set -euo pipefail
report=dist/build-info-linux-x64.txt
# sed consumes all input, so ldd never gets SIGPIPE under pipefail (head -n1 caused exit 141).
ldd --version | sed -n 1p > "$report"
git rev-parse HEAD >> "$report"
node scripts/elf-pagesize.mjs dist/linux-unpacked dist/TeamsPeach-*.AppImage --page 4096 --json dist/elf-report-linux-x64.json > elf.txt
cat elf.txt >> "$report"
sha256sum dist/*.AppImage dist/*.tar.gz dist/*-linux.yml >> "$report"
cat "$report"
- uses: actions/upload-artifact@v3
- name: Upload native release bundle and exact provisioning receipt
uses: actions/upload-artifact@v3
with:
name: teamspeach-linux-x64
name: teamspeach-native-${{ matrix.target }}
path: |
dist/*.AppImage
dist/*.tar.gz
dist/build-info-linux-x64.txt
dist/elf-report-linux-x64.json
dist/*-linux.yml
dist/native/TeamsPeach-*.AppImage
dist/native/TeamsPeach-*.tar.gz
dist/native/*.yml
dist/native/native-manifest.json
dist/native/${{ matrix.target }}/package-report.json
dist/native/${{ matrix.target }}/verification.json
dist/native/${{ matrix.target }}/native-deps.lock.json
if-no-files-found: error
linux-arm64:
runs-on: ubuntu-latest
container:
image: node:22-bookworm
env:
CARGO_TERM_COLOR: never
CARGO_BUILD_JOBS: "2"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
AR_aarch64_unknown_linux_gnu: aarch64-linux-gnu-ar
- name: Upload measured native smoke evidence
if: always()
uses: actions/upload-artifact@v3
with:
name: native-release-smoke-${{ matrix.target }}
path: |
native-smoke-${{ matrix.target }}/
native-migration-${{ matrix.target }}/
if-no-files-found: warn
assemble:
needs: [native-linux]
runs-on: teamspeach-native-linux-x64
steps:
- uses: actions/checkout@v4
- name: Version gate (tag = package.json = core/Cargo.toml)
run: node scripts/check-version.mjs
- name: Cross toolchain and user-mode emulator (container only, no binfmt)
run: |
set -euo pipefail
apt-get update
apt-get install -y --no-install-recommends build-essential cmake curl ca-certificates git \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user
- name: Rust toolchain
run: |
set -euo pipefail
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.96.0 --target aarch64-unknown-linux-gnu --target wasm32-unknown-unknown
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Core cross build and checks
run: |
set -euo pipefail
cargo build --manifest-path core/Cargo.toml --release --locked --target aarch64-unknown-linux-gnu
node scripts/binary-arch.mjs "${CARGO_TARGET_DIR:-target}/aarch64-unknown-linux-gnu/release/teamspeach-core" --expect linux-arm64
node scripts/elf-pagesize.mjs "${CARGO_TARGET_DIR:-target}/aarch64-unknown-linux-gnu/release/teamspeach-core" --page 16384
node scripts/core-smoke.mjs "${CARGO_TARGET_DIR:-target}/aarch64-unknown-linux-gnu/release/teamspeach-core" --wrapper "qemu-aarch64 -L /usr/aarch64-linux-gnu"
- name: Package
run: |
set -euo pipefail
npm ci
node scripts/dist.mjs --os linux --arch arm64
node scripts/update-feed-check.mjs --version "$(node -p "require('./package.json').version")" dist/*-linux-arm64.yml
- name: 16 KiB page check of every packaged ELF incl. the AppImage runtime (Asahi)
run: |
set -euo pipefail
report=dist/build-info-linux-arm64.txt
echo "glibc of build sysroot: $(dpkg-query -W -f='${Version}' libc6-dev-arm64-cross)" > "$report"
git rev-parse HEAD >> "$report"
node scripts/elf-pagesize.mjs dist/linux-arm64-unpacked dist/TeamsPeach-*-arm64.AppImage --page 16384 --json dist/elf-report-linux-arm64.json > elf.txt
cat elf.txt >> "$report"
sha256sum dist/*.AppImage dist/*.tar.gz dist/*-linux-arm64.yml >> "$report"
cat "$report"
- uses: actions/upload-artifact@v3
with:
name: teamspeach-linux-arm64
path: |
dist/*.AppImage
dist/*.tar.gz
dist/build-info-linux-arm64.txt
dist/elf-report-linux-arm64.json
dist/*-linux-arm64.yml
if-no-files-found: error
# The AppImage runtime must start on a stock system: run it in a slim container without development
# packages (no unversioned libz.so), natively for x64 and under qemu-aarch64 for arm64.
appimage-startup:
needs: [linux-x64, linux-arm64]
runs-on: ubuntu-latest
container:
image: node:22-bookworm-slim
steps:
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: x64 AppImage runtime starts without development packages
run: |
set -euo pipefail
echo "zlib files present:"; ls /usr/lib/x86_64-linux-gnu/ | grep '^libz\.' || true
app=$(ls artifacts/teamspeach-linux-x64/TeamsPeach-*.AppImage)
chmod +x "$app"
"$app" --appimage-version
- name: arm64 AppImage runtime starts under qemu-aarch64 (emulated)
run: |
set -euo pipefail
dpkg --add-architecture arm64
apt-get update
apt-get install -y --no-install-recommends qemu-user libc6:arm64 zlib1g:arm64
echo "arm64 zlib files present:"; ls /usr/lib/aarch64-linux-gnu/ | grep '^libz\.' || true
app=$(ls artifacts/teamspeach-linux-arm64/TeamsPeach-*-arm64.AppImage)
chmod +x "$app"
qemu-aarch64 -L / "$app" --appimage-version
name: teamspeach-native-x86_64-unknown-linux-gnu
path: artifacts/teamspeach-native-x86_64-unknown-linux-gnu
- uses: actions/download-artifact@v3
with:
name: teamspeach-native-aarch64-unknown-linux-gnu
path: artifacts/teamspeach-native-aarch64-unknown-linux-gnu
- name: Gitea transport unit tests (mocked HTTP, no publication)
run: python3 -m unittest discover -s xtask -p test_publish_release.py
- name: Merge strict native manifests and recheck every package digest
run: cargo run --locked -p xtask -- prepare-release --out artifacts
- uses: actions/upload-artifact@v3
with:
name: native-release-manifest
path: artifacts/native-manifest.json
if-no-files-found: error
publish:
needs: [linux-x64, linux-arm64, appimage-startup]
needs: [native-linux, assemble]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container:
image: node:22-bookworm
runs-on: teamspeach-native-linux-x64
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish release (draft → upload all → publish)
name: teamspeach-native-x86_64-unknown-linux-gnu
path: artifacts/teamspeach-native-x86_64-unknown-linux-gnu
- uses: actions/download-artifact@v3
with:
name: teamspeach-native-aarch64-unknown-linux-gnu
path: artifacts/teamspeach-native-aarch64-unknown-linux-gnu
- name: Validate packages, create draft, upload, verify remote hashes, publish
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
node scripts/check-version.mjs
cat > notes.md <<'EOF'
Linux x64 and Linux ARM64 (aarch64) are built in CI: tests, offline core check, ELF alignment check
(16 KiB pages for ARM64, including the AppImage runtime), see build-info-*.txt.
ARM64 is checked statically and under qemu, not on Apple Silicon. Packages are not signed.
Windows x64 is built on the developer machine from the same commit and attached separately
(provenance in *-win-x64-local-build-info.txt).
Automatic updates (from the first updater-capable version on): Windows x64 NSIS installation and
Linux AppImage install from this release's latest*.yml / <channel>*.yml feeds after user confirmation;
zip and tar.gz users are notified and replace files manually.
EOF
node scripts/publish-release.mjs artifacts notes.md
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITHUB_REF: ${{ github.ref }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: cargo run --locked -p xtask -- publish-release --out artifacts