chore: 升级 @anthropic-ai/claude-agent-sdk 到 0.2.76 #34
Workflow file for this run
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
| # GitHub Actions: 自动打包分发 | |
| # | |
| # 触发条件:推送 v* tag(如 v0.4.0) | |
| # 构建 macOS 和 Windows 产物并发布到 GitHub Releases | |
| # | |
| # 所需 GitHub Secrets(macOS 签名/公证,可选): | |
| # - MAC_CERTS: Base64 编码的 macOS Developer ID Application 证书 (.p12) | |
| # - MAC_CERTS_PASSWORD: 证书密码 | |
| # - APPLE_ID: Apple ID(公证用) | |
| # - APPLE_APP_SPECIFIC_PASSWORD: App-Specific 密码(公证用) | |
| # - APPLE_TEAM_ID: Apple Developer Team ID | |
| # GITHUB_TOKEN 由 GitHub Actions 自动提供,无需手动配置 | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| platform: mac | |
| vendor_platforms: "--platform darwin-arm64 --platform darwin-x64" | |
| - os: windows-latest | |
| platform: win | |
| vendor_platforms: "--platform win32-x64" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v4 | |
| - name: 安装 Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: 安装 Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: 安装依赖 | |
| run: bun install | |
| - name: 下载 Bun 二进制 | |
| run: bun run scripts/download-bun.ts ${{ matrix.vendor_platforms }} | |
| working-directory: apps/electron | |
| # macOS 代码签名准备 | |
| - name: 导入 macOS 签名证书 | |
| if: matrix.platform == 'mac' | |
| env: | |
| MAC_CERTS: ${{ secrets.MAC_CERTS }} | |
| MAC_CERTS_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }} | |
| run: | | |
| # 创建临时 keychain | |
| KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain | |
| KEYCHAIN_PASSWORD=$(openssl rand -base64 32) | |
| security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| # 导入证书 | |
| echo "$MAC_CERTS" | base64 --decode > $RUNNER_TEMP/cert.p12 | |
| security import $RUNNER_TEMP/cert.p12 -P "$MAC_CERTS_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" | |
| security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
| security list-keychain -d user -s "$KEYCHAIN_PATH" | |
| rm $RUNNER_TEMP/cert.p12 | |
| # 构建应用 | |
| - name: 构建 Electron 应用 | |
| run: bun run electron:build | |
| working-directory: . | |
| # 打包并发布到 GitHub Releases | |
| - name: 打包并发布 (macOS) | |
| if: matrix.platform == 'mac' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| APPLE_ID: ${{ secrets.APPLE_ID }} | |
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
| run: npx electron-builder --mac --publish always | |
| working-directory: apps/electron | |
| - name: 打包并发布 (Windows) | |
| if: matrix.platform == 'win' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx electron-builder --win --publish always | |
| working-directory: apps/electron |