Merge pull request #129 from MoYingJi/pr/feat/hotkey-focus-search-input #175
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
| # Dev 分支推送构建 | |
| name: Build Dev | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| paths: | |
| - "src/**" | |
| - "electron/**" | |
| - "native/**" | |
| - "shared/**" | |
| - "public/**" | |
| - "resources/**" | |
| - "scripts/**" | |
| - "package.json" | |
| - "pnpm-lock.yaml" | |
| - "electron-builder.config.ts" | |
| - "electron.vite.config.ts" | |
| - "tsconfig*.json" | |
| - ".github/workflows/dev.yml" | |
| workflow_dispatch: | |
| env: | |
| NODE_VERSION: 22.x | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| name: windows | |
| arch: x64 | |
| artifact_name_suffix: windows-x64 | |
| package_extension: zip | |
| build_cmd: pnpm build:win --x64 | |
| - os: macos-latest | |
| name: macOS | |
| arch: arm64 | |
| artifact_name_suffix: macos-arm64 | |
| package_extension: tar.gz | |
| build_cmd: pnpm build:mac --arm64 | |
| - os: macos-latest | |
| name: macOS | |
| arch: x64 | |
| artifact_name_suffix: macos-x64 | |
| package_extension: tar.gz | |
| build_cmd: pnpm build:mac --x64 | |
| - os: ubuntu-latest | |
| name: linux | |
| arch: x64 | |
| artifact_name_suffix: linux-x64 | |
| package_extension: tar.gz | |
| build_cmd: pnpm build:linux --x64 | |
| steps: | |
| - name: Check out git repository | |
| uses: actions/checkout@v5 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "native/audio-engine -> target\nnative/media-ctrl -> target" | |
| # Linux: 安装系统构建/打包依赖 | |
| - name: 安装系统依赖 (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --no-install-recommends -y \ | |
| libasound2-dev libdbus-1-dev pkg-config clang \ | |
| rpm libarchive-tools | |
| # 清理旧构建产物 | |
| - name: Clean workspace on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| if (Test-Path dist) { Remove-Item -Recurse -Force dist } | |
| if (Test-Path out) { Remove-Item -Recurse -Force out } | |
| - name: Clean workspace on macOS & Linux | |
| if: runner.os != 'Windows' | |
| run: rm -rf dist out | |
| # CI 不需要国内镜像 | |
| - name: 移除 .npmrc | |
| shell: bash | |
| run: rm -f .npmrc | |
| # 安装项目依赖 | |
| - name: Install dependencies | |
| run: pnpm install | |
| # 构建 | |
| - name: Build ${{ matrix.name }} ${{ matrix.arch }} | |
| run: ${{ matrix.build_cmd }} | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CSC_IDENTITY_AUTO_DISCOVERY: false | |
| # 上传构建产物 (Windows) | |
| - name: Upload Windows Setup | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-Windows-setup-${{ matrix.arch }} | |
| path: dist/*-setup.exe | |
| # 上传构建产物 (macOS) | |
| - name: Upload macOS DMG | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-macOS-dmg-${{ matrix.arch }} | |
| path: dist/*.dmg | |
| - name: Upload macOS Zip | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-macOS-zip-${{ matrix.arch }} | |
| path: dist/*.zip | |
| # 上传构建产物 (Linux) | |
| - name: Upload Linux AppImage | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-Linux-appimage-${{ matrix.arch }} | |
| path: dist/*.AppImage | |
| - name: Upload Linux DEB | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-Linux-deb-${{ matrix.arch }} | |
| path: dist/*.deb | |
| - name: Upload Linux RPM | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-Linux-rpm-${{ matrix.arch }} | |
| path: dist/*.rpm | |
| - name: Upload Linux Tar | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-Linux-tar-${{ matrix.arch }} | |
| path: dist/*.tar.gz | |
| - name: Upload Linux Pacman | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: SPlayer-Next-Linux-pacman-${{ matrix.arch }} | |
| path: dist/*.pacman |