Merge pull request #11 from H-Chris233/main

增加Linux支持
This commit is contained in:
TRIP authored and GitHub committed 2026-04-29 21:25:12 +08:00
commit ec9bdb8b73
1 file changed
+44 -3
+44 -3
View File
@@ -4,7 +4,7 @@ name: Release Tauri (cross-platform)
# - 手动 dispatch(用于测试构建,不发版)
#
# 输出:
# macOS arm64 .dmg + Windows x64 .msi/.exe,自动作为 GitHub Release 资产上传。
# macOS arm64 .dmg + Windows x64 .msi/.exe + Linux x64 .deb/.rpm/.AppImage,自动作为 GitHub Release 资产上传。
#
# macOS 分发:
# - 配好 APPLE_CERTIFICATE / APPLE_CERTIFICATE_PASSWORD / APPLE_ID /
@@ -32,6 +32,8 @@ jobs:
rust-target: aarch64-apple-darwin
- platform: windows-latest
rust-target: x86_64-pc-windows-msvc
- platform: ubuntu-22.04
rust-target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
@@ -51,6 +53,25 @@ jobs:
with:
workspaces: 'openless -all/app/src-tauri -> target'
- name: Install Linux bundle deps
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
file \
libasound2-dev \
libayatana-appindicator3-dev \
libfuse2 \
librsvg2-dev \
libssl-dev \
libwebkit2gtk-4.1-dev \
libxdo-dev \
patchelf \
rpm \
wget
- name: Install npm deps
working-directory: 'openless -all/app'
run: npm ci
@@ -140,17 +161,23 @@ jobs:
INSTALL: '0' # CI 不要装到 /Applications,也不要 reset TCC
run: bash scripts/build-mac.sh
# ── Windows:直接 tauri build,无 Info.plist 后处理 ──
# ── Windows:仅 Windows 跑通用 tauri build(Linux 用下方专用 step,避免重复构建)──
- name: Build (Windows)
if: matrix.platform == 'windows-latest'
working-directory: 'openless -all/app'
run: npm run tauri build
# ── Linux:产 deb / rpm / AppImage ──
- name: Build (Linux)
if: matrix.platform == 'ubuntu-22.04'
working-directory: 'openless -all/app'
run: npm run tauri -- build --bundles deb,rpm,appimage
# ── 收集产物 ──
- name: List artifacts (debug)
shell: bash
working-directory: 'openless -all/app/src-tauri/target/release/bundle'
run: ls -la macos/ dmg/ nsis/ msi/ 2>/dev/null || true
run: ls -la macos/ dmg/ nsis/ msi/ deb/ rpm/ appimage/ 2>/dev/null || true
- name: Upload macOS artifacts
if: matrix.platform == 'macos-latest'
@@ -171,6 +198,17 @@ jobs:
openless -all/app/src-tauri/target/release/bundle/msi/*.msi
if-no-files-found: error
- name: Upload Linux artifacts
if: matrix.platform == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: openless-linux-x64
path: |
openless -all/app/src-tauri/target/release/bundle/deb/*.deb
openless -all/app/src-tauri/target/release/bundle/rpm/*.rpm
openless -all/app/src-tauri/target/release/bundle/appimage/*.AppImage
if-no-files-found: error
# ── tag 推送时,同步上传到 GitHub Release ──
- name: Create / update release
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-tauri')
@@ -185,3 +223,6 @@ jobs:
openless -all/app/src-tauri/target/release/bundle/dmg/*.dmg
openless -all/app/src-tauri/target/release/bundle/nsis/*.exe
openless -all/app/src-tauri/target/release/bundle/msi/*.msi
openless -all/app/src-tauri/target/release/bundle/deb/*.deb
openless -all/app/src-tauri/target/release/bundle/rpm/*.rpm
openless -all/app/src-tauri/target/release/bundle/appimage/*.AppImage