跳过内容

Page/area: Capgo marketing website. Role: Website copy sentence. Seen in: component doc/SignupCta.astro, component Hero.astro. Message key `hero_subtitle_v2` (Hero Subtitle V2).

准备粘贴

包含安装、同步和源Markdown指南。

示例场景

假设您有:

  • 应用程序版本 1.2.3(旧版本)- 使用生产频道
  • 应用程序版本 2.0.0(新版本,包含重大更改)- 使用 v2 频道
  • Live update 1.2.4(兼容 1.2.3)
  • Live update 2.0.1(兼容 2.0.0)

策略:始终使用 defaultChannel 为主要版本

标题:策略:始终使用 defaultChannel 为主要版本

推荐方法: 设置 defaultChannel 复制到剪贴板

// Version 1.x releases
defaultChannel: 'v1'
// Version 2.x releases
defaultChannel: 'v2'
// Version 3.x releases (future)
defaultChannel: 'v3'

1. 为新版本创建频道

标题:1. 为新版本创建频道
终端窗口
# Create channel for version 2.x
npx @capgo/cli channel add v2

2. 更新 Capacitor 配置为版本 2.0.0

2. 更新 Capacitor 配置为版本 2.0.0

在发布 2.0.0 版本到应用商店之前,请更新您的 Capacitor 配置:

capacitor.配置文件
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
appId: 'com.example.app',
appName: 'Example App',
plugins: {
CapacitorUpdater: {
// ... other options
defaultChannel: 'v2' // All 2.0.0 users will use v2 channel
}
}
};
export default config;

3.独立管理Code分支

标题:3.独立管理Code分支

为应用程序版本之间保持兼容性而创建独立的Git分支:

终端窗口
# Create and maintain a branch for version 1.x updates
git checkout -b v1-maintenance
git push origin v1-maintenance
# Your main branch continues with version 2.x development
git checkout main

Critical: Never push JavaScript bundles to older apps that expect native code/APIs they don’t have。Always build updates from the appropriate branch.

  • 永远不要将JavaScript包推送到期望的本机__CAPGO_KEEP_0__/APIs但没有的旧应用程序。始终从适当的分支构建更新:v1-maintenance branch
  • :对于1.x应用程序的更新(生产频道): 对于 2.x 应用程序(v2 频道)的更新
终端窗口
# For 1.x updates: Build from v1-maintenance branch
git checkout v1-maintenance
# Make your 1.x compatible changes here
npx @capgo/cli bundle upload --channel production
# For 2.x updates: Build from main branch
git checkout main
# Make your 2.x changes here
npx @capgo/cli bundle upload --channel v2

context: Capgo营销网站. 角色: UI标签. 见于: 页面代理/[slug].astro. 消息键 `agents_page_copy_label` (代理页面复制标签).

5. 启用自我分配
终端窗口
# Allow apps to self-assign to v2 channel
npx @capgo/cli channel set v2 --self-assign

Section titled “5. 启用自我分配”

6. 部署到应用商店

Section titled “6. 部署到应用商店”

适应未来的版本

适应未来的版本

当您发布3.0.0版本时,包含更多的破坏性更改时:

终端窗口
# Create channel for version 3.x
npx @capgo/cli channel add v3
// capacitor.config.ts for version 3.0.0
const config: CapacitorConfig = {
// ...
plugins: {
CapacitorUpdater: {
defaultChannel: 'v3' // Version 3.x users
}
}
};

现在您可以推送任何版本的更新:

  • production channel → 1.x 版本用户
  • v2 channel → 2.x 版本用户
  • v3 channel → 3.x 版本用户

7. 清理(迁移后)

标题:7. 清理(迁移后)

所有用户迁移到 2.x 版本后(约 3-4 个月):

  1. 移除 defaultChannel 从您的 Capacitor 配置中
  2. 删除 v2 频道:
终端窗口
npx @capgo/cli channel delete v2
  1. 删除 v1-maintenance Branch:
终端窗口
git branch -d v1-maintenance
git push origin --delete v1-maintenance

在每个渠道中都要彻底测试更新之前部署

维护版本1.x更新

标题:维护版本1.x更新

要发送与版本1.x兼容的更新:

  1. 切换到 v1-maintenance branch:
终端窗口
git checkout v1-maintenance
  1. 在此处进行更改并提交:
终端窗口
# Make 1.x compatible changes
git add .
git commit -m "Fix for v1.x"
git push origin v1-maintenance
  1. 构建并上传到生产频道:
终端窗口
npx @capgo/cli bundle upload --channel production

继续从 Breaking Changes

标题:继续从 Breaking Changes

如果您正在使用 重大变更 来规划频道路由和分阶段发布,连接它到 频道 频道 频道 频道 频道 频道 为频道的实现细节, 为 Beta Testing Solution 的产品工作流程, 和 版本目标解决方案 为 Version Targeting Solution 的产品工作流程