RELEASE-WORKFLOW.md 3.5 KB

Release 工作流文档

概述

该工作流用于自动化构建和发布 Claude AI Installer 应用程序,支持 Windows、macOS 和 Linux 三个平台。

触发条件

on:
  push:
    tags:
      - 'v*'

当推送以 v 开头的 tag 时触发(如 v1.0.0v2.1.3)。


工作流程图

┌─────────────────────┐
│   推送 v* 标签       │
└──────────┬──────────┘
           ▼
┌─────────────────────────────────────────────────────┐
│              Job 1: build (并行执行)                  │
├─────────────┬─────────────┬─────────────┬───────────┤
│  Windows    │  macOS ARM  │ macOS Intel │  Linux    │
│  x64        │  (M1/M2/M3) │    x64      │   x64     │
└─────────────┴─────────────┴─────────────┴───────────┘
           │
           ▼
┌─────────────────────┐
│  Job 2: release     │
│  - 下载所有构建产物  │
│  - 创建 GitHub Release │
│  - 上传安装包        │
└─────────────────────┘

Job 详细说明

Job 1: build

构建矩阵:

平台 运行环境 Target
Windows windows-latest x86_64-pc-windows-msvc
macOS ARM macos-latest aarch64-apple-darwin
macOS Intel macos-latest x86_64-apple-darwin
Linux ubuntu-22.04 x86_64-unknown-linux-gnu

步骤:

步骤 说明
Checkout code 检出 main 分支最新代码
Setup Node.js 配置 Node.js 20
Install Rust 安装 Rust 工具链及对应 target
Cache Cargo 缓存 Cargo 依赖加速构建
Install Linux deps (仅 Linux) 安装 GTK、WebKit 等系统依赖
Install dependencies 安装 npm 依赖
Build application 执行构建脚本 node scripts/build.js
Upload artifacts 上传构建产物到 artifacts-{platform}

环境变量:

  • TAURI_SIGNING_PRIVATE_KEY - Tauri 签名私钥(来自 Secrets)

Job 2: release

依赖: build

运行环境: ubuntu-latest

权限: contents: write

步骤 说明
Download artifacts 下载所有平台的构建产物并合并
List artifacts 列出产物文件(调试用)
Create Release 创建 GitHub Release 并上传文件

发布产物

平台 文件 说明
Windows *-win-x64-setup.exe NSIS 安装程序(推荐)
*-win-x64-portable.exe 便携版
*-win-x64.msi MSI 安装程序
macOS *-mac-arm64.dmg Apple Silicon
*-mac-x64.dmg Intel
Linux *-linux-x64.deb Debian/Ubuntu
*-linux-x64.AppImage 通用 AppImage

所需 Secrets

名称 用途
TAURI_SIGNING_PRIVATE_KEY Tauri 应用签名私钥
GITHUB_TOKEN GitHub Release 创建(自动提供)

使用方法

# 创建并推送版本标签
git tag v1.0.0
git push origin v1.0.0

工作流将自动执行构建并创建 Release。