From 787760d02cac1c9d35f71e29cfbdb6bfaaec06e9 Mon Sep 17 00:00:00 2001 From: bincxz <16399091+binaricat@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:37:42 +0800 Subject: [PATCH] fix(ci): build Linux x64 in debian:bullseye container for native modules The Linux x64 AppImage was missing the compiled node-pty native module (pty.node), causing the app to crash on launch. This happened because the bare ubuntu-latest runner lacked build-essential/python3 needed by node-gyp to compile native addons. Move the Linux x64 build into a dedicated job using debian:bullseye container (matching the ARM64 job) which: - Installs build-essential, python3 and other native build deps - Ensures node-pty, ssh2, cpu-features compile correctly - Pins GLIBC to 2.31 for broader distro compatibility Fixes #264 --- .github/workflows/build.yml | 58 ++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b41f42f0f..c472bd7ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,9 +25,6 @@ jobs: - name: windows os: windows-latest pack_script: pack:win - - name: linux-x64 - os: ubuntu-latest - pack_script: pack:linux-x64 env: VITE_SYNC_GITHUB_CLIENT_ID: ${{ secrets.VITE_SYNC_GITHUB_CLIENT_ID }} VITE_SYNC_GOOGLE_CLIENT_ID: ${{ secrets.VITE_SYNC_GOOGLE_CLIENT_ID }} @@ -79,6 +76,59 @@ jobs: release/*.tar.gz if-no-files-found: ignore + # Dedicated job for Linux x64 — builds inside Debian Bullseye (GLIBC 2.31) + # to ensure native modules (node-pty, ssh2) compile correctly and to + # maintain GLIBC compatibility with older distros. + build-linux-x64: + name: build-linux-x64 + runs-on: ubuntu-latest + container: + image: debian:bullseye + env: + VITE_SYNC_GITHUB_CLIENT_ID: ${{ secrets.VITE_SYNC_GITHUB_CLIENT_ID }} + VITE_SYNC_GOOGLE_CLIENT_ID: ${{ secrets.VITE_SYNC_GOOGLE_CLIENT_ID }} + VITE_SYNC_GOOGLE_CLIENT_SECRET: ${{ secrets.VITE_SYNC_GOOGLE_CLIENT_SECRET }} + VITE_SYNC_ONEDRIVE_CLIENT_ID: ${{ secrets.VITE_SYNC_ONEDRIVE_CLIENT_ID }} + steps: + - name: Install build dependencies + run: | + apt-get update + apt-get install -y curl build-essential python3 git libfuse2 file rpm + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt-get install -y nodejs + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install deps + run: npm ci + + - name: Set version + shell: bash + run: | + if [[ "$GITHUB_REF" == refs/tags/v* ]]; then + VERSION="${GITHUB_REF_NAME#v}" + else + VERSION="${GITHUB_SHA:0:7}" + fi + echo "Setting version to ${VERSION}" + npm pkg set version="${VERSION}" + + - name: Build package + env: + ELECTRON_BUILDER_PUBLISH: "never" + run: npm run pack:linux-x64 + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: netcatty-linux-x64 + path: | + release/*.AppImage + release/*.deb + release/*.rpm + if-no-files-found: ignore + # Dedicated job for Linux ARM64 — builds inside Debian Bullseye (GLIBC 2.31) # to ensure compatibility with older distros like UOS/Deepin (GLIBC 2.28). # Key: GLIBC < 2.34 avoids the libpthread-merge symbol requirement. @@ -136,7 +186,7 @@ jobs: release: name: release runs-on: ubuntu-latest - needs: [build, build-linux-arm64] + needs: [build, build-linux-x64, build-linux-arm64] if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish_release) permissions: contents: write