name: Release on: push: tags: - 'v*' permissions: contents: write jobs: release: runs-on: ${{ matrix.os }} strategy: matrix: include: - os: windows-latest platform: win32 - os: ubuntu-latest platform: linux - os: macos-latest platform: darwin steps: - name: Checkout code uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Setup pnpm uses: pnpm/action-setup@v2 with: version: 10.12.3 run_install: false - name: Get pnpm store directory shell: bash run: | echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - name: Setup pnpm cache uses: actions/cache@v3 with: path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build application run: | pnpm run build pnpm run dist env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: List build files (debug) shell: bash run: | echo "Listing release directory:" ls -la release/ || echo "No release directory found" find . -name "*.exe" -o -name "*.dmg" -o -name "*.AppImage" -o -name "*.deb" -o -name "*.rpm" || echo "No build files found" - name: Upload Release Assets uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: | release/*.exe release/*.zip release/*.AppImage name: "CC Switch ${{ github.ref_name }}" body: | ## CC Switch ${{ github.ref_name }} Claude Code 供应商切换工具 ### 下载 #### Windows 用户 - **安装版 (推荐)**: `CC.Switch.Setup.${{ github.ref_name }}.exe` - **便携版**: `CC.Switch.${{ github.ref_name }}.exe` #### macOS 用户 - **ARM64 (M1/M2/M3)**: `CC.Switch-${{ github.ref_name }}-arm64-mac.zip` - **Intel x64**: `CC.Switch-${{ github.ref_name }}-mac.zip` #### Linux 用户 - **AppImage**: `CC.Switch-${{ github.ref_name }}.AppImage` ### 使用说明 1. 下载对应平台的文件 2. Windows 推荐使用安装版获得最佳体验 3. macOS 下载 ZIP 后解压即可使用 4. Linux 下载后添加执行权限: `chmod +x CC.Switch-*.AppImage` env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}