fix: resolve Rust 1.89 type errors and unit test assertions #57
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag version (e.g., v3.2.0)' | |
| required: false | |
| type: string | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # ── Frontend (web build – shared by all platforms) ─────────────────────────── | |
| build-web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build web | |
| run: pnpm build | |
| env: | |
| CI: true | |
| - name: Upload web build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web-build | |
| path: dist | |
| # ── Tauri desktop app (one job per target) ─────────────────────────────────── | |
| build-tauri: | |
| needs: build-web | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: ubuntu-22.04 | |
| args: '' | |
| label: ubuntu-x64 | |
| - platform: windows-latest | |
| args: '' | |
| label: windows-x64 | |
| - platform: macos-latest | |
| args: --target aarch64-apple-darwin | |
| label: macos-apple-silicon | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'pnpm' | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Install frontend dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Download web build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: web-build | |
| path: dist | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@1.85.0 | |
| - name: Cache Rust cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri | |
| - name: Install Linux build deps | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libappindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf \ | |
| libffmpegthumbnailer-dev \ | |
| libjpeg-dev \ | |
| libvips-dev \ | |
| libglib2.0-dev \ | |
| ffmpeg | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| releaseName: 'SubLens ${{ github.ref_name }}' | |
| releaseBody: | | |
| ## SubLens ${{ github.ref_name }} | |
| 视频字幕提取工具,从视频中提取硬编码字幕,支持多种格式输出。 | |
| ### Downloads | |
| | Platform | Architecture | File | | |
| |---------|-------------|------| | |
| | macOS | Apple Silicon (M1/M2/M3) | `SubLens_macos-apple-silicon.tar.gz` | | |
| | macOS | Intel | `SubLens_macos-intel.tar.gz` | | |
| | Linux | x86_64 | `SubLens_ubuntu-x64.tar.gz` | | |
| | Windows | x64 | `SubLens_windows-x64.zip` | | |
| ### Features | |
| - 视频字幕提取 via OCR (Tesseract.js / PaddleOCR / EasyOCR) | |
| - 多种导出格式:SRT, VTT, ASS, SSA, JSON, TXT, LRC, SBV, CSV | |
| - 多语言支持:中文、英文、日文、韩文等 | |
| - 键盘快捷键 & 主题切换 | |
| - 桌面 GUI + CLI 双模式 | |
| ### Installation | |
| 1. Download the archive for your platform | |
| 2. Extract and run `SubLens` (Linux/macOS) or `SubLens.exe` (Windows) | |
| 3. **macOS**: run `xattr -cr ./SubLens` if blocked by Gatekeeper | |
| args: ${{ matrix.args }} | |