fix(ci): 发布工作流在 Windows 上用 bash+node 执行版本解析,避免 PowerShell 解析 JS 报错 #7
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
| # Tauri 桌面端:仅构建(不发布),用于 PR 与 main 分支 | |
| # 触发:推送到 main、或向 main/release 提 PR | |
| name: Build Desktop (CI) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| - release | |
| jobs: | |
| build-tauri: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: windows-latest | |
| args: '' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'npm' | |
| cache-dependency-path: desktop/package-lock.json | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: desktop/src-tauri | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| working-directory: desktop | |
| - name: Download bundled JDK 11 (Windows) | |
| run: .\scripts\download-jdk11.ps1 | |
| working-directory: desktop | |
| - name: Build (no release) | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| projectPath: desktop | |
| args: ${{ matrix.args }} |