From 4f1e457cfa3a5dd2b26d02ed4301cae0ee85d710 Mon Sep 17 00:00:00 2001 From: aeoform <2790848120@qq.com> Date: Sat, 16 May 2026 00:00:22 +0800 Subject: [PATCH] feat(ci): build fcitx5 plugin into Linux deb/rpm packages - Add "Build fcitx5 plugin" step to release-tauri.yml: compiles the C++ plugin via cmake, copies .so + .conf to src-tauri/linux-fcitx5-plugin/ for the Tauri bundler. - Override tauri build --config to include deb.files / rpm.files that place the plugin at /usr/lib/fcitx5/ so it's auto-detected after install. - Add fcitx5, fcitx5-module-dbus as deb/rpm dependencies. - Local builds unaffected (config is CI-only via --config flag). Co-Authored-By: Claude Opus 4.7 --- .github/workflows/release-tauri.yml | 52 +++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-tauri.yml b/.github/workflows/release-tauri.yml index 05079cf4..18ce840b 100644 --- a/.github/workflows/release-tauri.yml +++ b/.github/workflows/release-tauri.yml @@ -339,8 +339,22 @@ jobs: throw "MSI installer smoke failed with exit $LASTEXITCODE" } - # ── Linux:产 deb / rpm / AppImage ── - # bundle.resources 里的 Windows TSF DLL 占位对 Linux 包没意义,用空 map 覆盖跳过。 + # ── Linux:先编译 fcitx5 插件,再产 deb / rpm / AppImage ── + - name: Build fcitx5 plugin + if: matrix.platform == 'ubuntu-22.04' + shell: bash + working-directory: 'openless-all/scripts/linux-fcitx5-plugin' + run: | + sudo apt-get install -y cmake fcitx5-dev + mkdir -p build && cd build + cmake .. + make + # 把插件 .so + .conf 复制到 src-tauri/linux-fcitx5-plugin/ 下面, + # 供 tauri deb/rpm bundler 的 files 配置使用。 + mkdir -p "$GITHUB_WORKSPACE/openless-all/app/src-tauri/linux-fcitx5-plugin" + cp libopenless.so "$GITHUB_WORKSPACE/openless-all/app/src-tauri/linux-fcitx5-plugin/" + cp openless.conf "$GITHUB_WORKSPACE/openless-all/app/src-tauri/linux-fcitx5-plugin/" + - name: Build (Linux) if: matrix.platform == 'ubuntu-22.04' shell: bash @@ -349,13 +363,39 @@ jobs: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} run: | + # 构建带 fcitx5 插件的 deb/rpm/AppImage。 + # 插件 .so + .conf 由上一步 Build fcitx5 plugin 生成并复制到 + # src-tauri/linux-fcitx5-plugin/ 下。 + cat > /tmp/tauri-linux-config.json << 'CONFIG_EOF' + { + "bundle": { + "resources": {}, + "linux": { + "deb": { + "depends": ["fcitx5", "fcitx5-module-dbus", "libdbus-1-3"], + "files": { + "/usr/lib/fcitx5/libopenless.so": "linux-fcitx5-plugin/libopenless.so", + "/usr/share/fcitx5/addon/openless.conf": "linux-fcitx5-plugin/openless.conf" + } + }, + "rpm": { + "depends": ["fcitx5", "fcitx5-module-dbus"], + "files": { + "/usr/lib64/fcitx5/libopenless.so": "linux-fcitx5-plugin/libopenless.so", + "/usr/share/fcitx5/addon/openless.conf": "linux-fcitx5-plugin/openless.conf" + } + } + } + } + } + CONFIG_EOF if [ -n "${TAURI_SIGNING_PRIVATE_KEY:-}" ]; then - npm run tauri -- build --bundles deb,rpm,appimage \ - --config '{"bundle":{"resources":{},"createUpdaterArtifacts":true}}' + jq '.bundle.createUpdaterArtifacts = true' /tmp/tauri-linux-config.json > /tmp/tauri-linux-config-signed.json + CONFIG_FILE=/tmp/tauri-linux-config-signed.json else - npm run tauri -- build --bundles deb,rpm,appimage \ - --config '{"bundle":{"resources":{}}}' + CONFIG_FILE=/tmp/tauri-linux-config.json fi + npm run tauri -- build --bundles deb,rpm,appimage --config "$CONFIG_FILE" - name: Disambiguate macOS updater bundle filename if: startsWith(matrix.platform, 'macos') && env.TAURI_SIGNING_PRIVATE_KEY != ''