name: Release on: push: tags: - 'v*' permissions: contents: write jobs: release: runs-on: ${{ matrix.os }} strategy: matrix: include: - os: windows-latest - os: ubuntu-latest - os: macos-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Setup Rust uses: dtolnay/rust-toolchain@stable - name: Install Linux system deps if: runner.os == 'Linux' shell: bash run: | set -euxo pipefail sudo apt-get update # Core build tools and pkg-config sudo apt-get install -y --no-install-recommends \ build-essential \ pkg-config \ curl \ wget \ file \ patchelf \ libssl-dev # GTK/GLib stack for gdk-3.0, glib-2.0, gio-2.0 sudo apt-get install -y --no-install-recommends \ libgtk-3-dev \ librsvg2-dev \ libayatana-appindicator3-dev # WebKit2GTK (version differs across Ubuntu images; try 4.1 then 4.0) sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev \ || sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.0-dev # libsoup also changed major version; prefer 3.0 with fallback to 2.4 sudo apt-get install -y --no-install-recommends libsoup-3.0-dev \ || sudo apt-get install -y --no-install-recommends libsoup2.4-dev - name: Setup pnpm uses: pnpm/action-setup@v2 with: version: 10.12.3 run_install: false - name: Get pnpm store directory id: pnpm-store shell: bash run: echo "path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - name: Setup pnpm cache uses: actions/cache@v3 with: path: ${{ steps.pnpm-store.outputs.path }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}-pnpm-store- - name: Install frontend deps run: pnpm install --frozen-lockfile - name: Build and Release (Tauri) uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tagName: ${{ github.ref_name }} releaseName: CC Switch ${{ github.ref_name }} releaseBody: | ## CC Switch ${{ github.ref_name }} Claude Code 供应商切换工具(Tauri 构建) - Windows: .msi / NSIS 安装包 - macOS: .dmg / .app 压缩包 - Linux: AppImage / deb / rpm 如遇未知开发者提示,请在系统隐私与安全设置中选择“仍要打开”。 tauriScript: pnpm tauri - name: List generated bundles (debug) if: always() shell: bash run: | echo "Listing bundles in src-tauri/target..." find src-tauri/target -maxdepth 4 -type f -name "*.*" 2>/dev/null || true