From e143ef30e31e4c992a2d4e6b9f4f8bbbdb4ef53b Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 10 Sep 2025 22:53:09 +0800 Subject: [PATCH] =?UTF-8?q?-=20chore(ci):=20=E5=9B=BA=E5=AE=9A=20runner=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=8C=E7=A7=BB=E9=99=A4=20macOS-13?= =?UTF-8?q?=EF=BC=9B=E5=8D=87=E7=BA=A7=20actions/cache@v4=20=E4=B8=8E=20ac?= =?UTF-8?q?tion-gh-release@v2=20-=20fix(linux):=20=E4=BD=BF=E7=94=A8=20ubu?= =?UTF-8?q?ntu-20.04=20=E6=9E=84=E5=BB=BA=E5=B9=B6=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=20AppImage=EF=BC=8C=E9=99=8D=E4=BD=8E=20glib?= =?UTF-8?q?c/=E5=86=85=E6=A0=B8=E5=9F=BA=E7=BA=BF=20-=20fix(windows):=20?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=99=A8=E5=90=AF=E7=94=A8=20WebView2=20?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=BC=95=E5=AF=BC=EF=BC=88silent=EF=BC=89?= =?UTF-8?q?=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=8D=E5=BC=80=E5=90=AF=20--disa?= =?UTF-8?q?ble-gpu=20-=20fix(macos):=20ARM64=20=E6=9E=84=E5=BB=BA=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E5=8C=85=EF=BC=88zip=EF=BC=89=EF=BC=8C=E8=A6=86?= =?UTF-8?q?=E7=9B=96=20Intel=20=E4=B8=8E=20Apple=20Silicon=20-=20chore(ver?= =?UTF-8?q?sion):=20bump=20to=20v3.1.2=EF=BC=88=E5=85=BC=E5=AE=B9=E6=80=A7?= =?UTF-8?q?=E7=83=AD=E4=BF=AE=E5=A4=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 34 ++++++++++++++++++++++------------ package.json | 2 +- src-tauri/Cargo.toml | 4 ++-- src-tauri/tauri.conf.json | 10 ++++++++-- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a16de1..2eff5de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: tags: - - 'v*' + - "v*" permissions: contents: write @@ -14,9 +14,10 @@ jobs: strategy: matrix: include: - - os: windows-latest - - os: ubuntu-latest - - os: macos-latest + # 固定 runner 版本,避免 latest 漂移导致 ABI 升级 + - os: windows-2022 + - os: ubuntu-20.04 + - os: macos-14 steps: - name: Checkout @@ -25,13 +26,13 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: "20" - name: Setup Rust uses: dtolnay/rust-toolchain@stable - - name: Add macOS targets - if: runner.os == 'macOS' + - name: Add macOS targets (ARM64 only for universal) + if: runner.os == 'macOS' && runner.arch == 'ARM64' run: | rustup target add aarch64-apple-darwin x86_64-apple-darwin @@ -74,7 +75,7 @@ jobs: run: echo "path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT - name: Setup pnpm cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.pnpm-store.outputs.path }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} @@ -83,10 +84,12 @@ jobs: - name: Install frontend deps run: pnpm install --frozen-lockfile - - name: Build Tauri App (macOS) - if: runner.os == 'macOS' + - name: Build Tauri App (macOS, universal on ARM64) + if: runner.os == 'macOS' && runner.arch == 'ARM64' run: pnpm tauri build --target universal-apple-darwin + # macOS 仅保留通用包(在 macOS-14 / ARM64 运行器上构建) + - name: Build Tauri App (Windows) if: runner.os == 'Windows' run: pnpm tauri build @@ -165,7 +168,7 @@ jobs: run: | set -euxo pipefail mkdir -p release-assets - # 仅上传安装包(deb) + # 优先 DEB,同时若存在 AppImage 一并上传 DEB=$(find src-tauri/target/release/bundle -name "*.deb" | head -1 || true) if [ -n "$DEB" ]; then cp "$DEB" release-assets/ @@ -174,6 +177,13 @@ jobs: echo "No .deb found" >&2 exit 1 fi + APPIMAGE=$(find src-tauri/target/release/bundle -name "*.AppImage" | head -1 || true) + if [ -n "$APPIMAGE" ]; then + cp "$APPIMAGE" release-assets/ + echo "AppImage copied" + else + echo "No AppImage found (optional)" + fi - name: List prepared assets shell: bash @@ -181,7 +191,7 @@ jobs: ls -la release-assets || true - name: Upload Release Assets - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: tag_name: ${{ github.ref_name }} name: CC Switch ${{ github.ref_name }} diff --git a/package.json b/package.json index 44eb421..d419a8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cc-switch", - "version": "3.1.1", + "version": "3.1.2", "description": "Claude Code & Codex 供应商切换工具", "scripts": { "dev": "pnpm tauri dev", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 7591881..20d1617 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "cc-switch" -version = "3.1.1" +version = "3.1.2" description = "Claude Code & Codex 供应商配置管理工具" authors = ["Jason Young"] license = "MIT" -repository = "https://github.com/jasonyoung/cc-switch" +repository = "https://github.com/farion1231/cc-switch" edition = "2024" rust-version = "1.85.0" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d784b49..d377778 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "CC Switch", - "version": "3.1.1", + "version": "3.1.2", "identifier": "com.ccswitch.desktop", "build": { "frontendDist": "../dist", @@ -35,6 +35,12 @@ "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico" - ] + ], + "windows": { + "webviewInstallMode": { + "type": "downloadBootstrapper", + "silent": true + } + } } }