fix: Release CI — 配置 npm registry + --prefer-offline 加速安装 #63
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 | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org | |
| jobs: | |
| # ── Frontend (web build – shared by all platforms) ─────────────────────────── | |
| build-web: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install dependencies | |
| run: | | |
| npm config set registry https://registry.npmjs.org | |
| npm install --prefer-offline --no-audit --loglevel=error | |
| - name: Build web | |
| run: npm run 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: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install frontend dependencies | |
| run: | | |
| npm config set registry https://registry.npmjs.org | |
| npm install --prefer-offline --no-audit --loglevel=error | |
| - name: Download web build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: web-build | |
| path: dist | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@1.89.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: 'CaptionFab ${{ github.ref_name }}' | |
| releaseBody: | | |
| ## CaptionFab ${{ github.ref_name }} | |
| 智能视频字幕提取工具,从视频中精准提取硬编码字幕,支持 9 种专业格式输出。 | |
| ### Downloads | |
| | Platform | Architecture | File | | |
| |---------|-------------|------| | |
| | macOS | Apple Silicon (M1/M2/M3) | `CaptionFab_macos-apple-silicon.tar.gz` | | |
| | Linux | x86_64 | `CaptionFab_ubuntu-x64.tar.gz` | | |
| | Windows | x64 | `CaptionFab_windows-x64.zip` | | |
| ### Features | |
| - 🤖 多引擎 OCR:PaddleOCR · EasyOCR · Tesseract.js,80+ 语言 | |
| - ⚡ 五阶段后处理:标准化 → 去噪 → 合并 → 融合 → 校准 | |
| - 📦 9 种导出格式:SRT, VTT, ASS, SSA, JSON, CSV, TXT, LRC, SBV | |
| - 🎬 智能场景检测:直方图 + 卡方检验,减少 60% 无效 OCR | |
| - 🔧 纯 Rust 后端:Tokio 异步 I/O,零外部运行时依赖 | |
| - 🛡️ 置信度校准:混语 · 短文本 · 重复字符自动降权 | |
| ### Installation | |
| 1. Download the archive for your platform | |
| 2. Extract and run `CaptionFab` (Linux/macOS) or `CaptionFab.exe` (Windows) | |
| 3. **macOS**: run `xattr -cr ./CaptionFab` if blocked by Gatekeeper | |
| args: ${{ matrix.args }} |