Skip to content

feat: refactor release workflow and add special update handling for electron app#4969

Merged
Soulter merged 1 commit intomasterfrom
feat/ci-electron-app-update
Feb 8, 2026
Merged

feat: refactor release workflow and add special update handling for electron app#4969
Soulter merged 1 commit intomasterfrom
feat/ci-electron-app-update

Conversation

@Soulter
Copy link
Member

@Soulter Soulter commented Feb 8, 2026

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

重构发布流水线,在统一的工作流中构建并分发 dashboard、desktop 和 PyPI 包,同时为 Electron dashboard 客户端添加特殊的更新处理逻辑。

新功能:

  • 添加一个 dashboard 构建和打包任务,将 dashboard 构建产物发布到 GitHub Releases,并可选地发布到 Cloudflare R2。
  • 引入一个 PyPI 发布任务,在成功完成 GitHub release 后,使用 uv 构建 Python 包并上传到 PyPI。
  • 在 dashboard 页头中添加一个针对 Electron 的特定更新流程,通过带有确认对话框和引导步骤的方式,将用户引导到对应的 GitHub release 页面。

改进:

  • 重命名并重构 GitHub Actions 发布工作流,以统一编排 dashboard、desktop 和发布流程,并共享标签解析逻辑以及基于变更日志文件生成的发布说明。
  • 改进 dashboard 的更新 UI,增加版本元数据展示、更安全的外部重定向处理,以及本地化的更新确认流程提示信息。

CI:

  • 移除旧的 auto_release 工作流,改用整合后的发布工作流。
Original summary in English

Summary by Sourcery

Refactor the release pipeline to build and distribute dashboard, desktop, and PyPI packages in a unified workflow while adding special update handling for the Electron dashboard client.

New Features:

  • Add a dashboard build and packaging job that publishes dashboard artifacts to GitHub Releases and optionally to Cloudflare R2.
  • Introduce a PyPI publish job that builds the Python package with uv and uploads it to PyPI after a successful GitHub release.
  • Add an Electron-specific update flow in the dashboard header that directs users to the appropriate GitHub release page with a confirmation dialog and guided steps.

Enhancements:

  • Rename and restructure the GitHub Actions release workflow to orchestrate dashboard, desktop, and release publication with shared tag resolution and generated release notes from changelog files.
  • Improve the dashboard update UI with version metadata display, safer external redirect handling, and localized messaging for the update confirmation flow.

CI:

  • Remove the legacy auto_release workflow in favor of the consolidated release workflow.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 8, 2026
@dosubot
Copy link

dosubot bot commented Feb 8, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@Soulter Soulter merged commit 85e1764 into master Feb 8, 2026
5 checks passed
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 1 个问题,并给出了一些整体反馈:

  • VerticalHeader.vueonMounted 钩子中,isElectronApp.value 在 try/catch 之后总是被设置为 true,这会覆盖运行时检测逻辑,并很可能在浏览器中强制启用仅适用于 Electron 的行为;这看起来是无意的,应当移除或加以保护。
  • release.yml 中的多个 job 里都重复了 Resolve tag 的 shell 逻辑;建议将其抽取为一个可复用的 composite action,或者单独的步骤(例如 run: ./scripts/resolve-tag.sh),以避免不同实现之间出现偏差。
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `VerticalHeader.vue`'s `onMounted` hook, `isElectronApp.value` is always set to `true` after the try/catch, which overrides the runtime detection logic and likely forces Electron-only behavior in the browser; this looks unintended and should be removed or guarded.
- The `Resolve tag` shell logic is duplicated across multiple jobs in `release.yml`; consider extracting it into a reusable composite action or a separate step with `run: ./scripts/resolve-tag.sh` to avoid drift between implementations.

## Individual Comments

### Comment 1
<location> `dashboard/src/layouts/full/vertical-header/VerticalHeader.vue:384` </location>
<code_context>
+  } catch {
+    isElectronApp.value = false;
+  }
+  isElectronApp.value = true
+});
+
</code_context>

<issue_to_address>
**issue (bug_risk):** Unconditional `isElectronApp = true` overrides the runtime check and likely breaks browser-only behavior.

The runtime check against `window.astrbotDesktop` is immediately overridden by `isElectronApp.value = true`, so all environments are treated as Electron, which can break web deployments.

If this was only for debugging, please remove the forced assignment. Otherwise, keep just the detection logic, e.g.:
```ts
onMounted(async () => {
  try {
    isElectronApp.value = !!window.astrbotDesktop?.isElectron ||
      !!(await window.astrbotDesktop?.isElectronRuntime?.());
  } catch {
    isElectronApp.value = false;
  }
});
```
</issue_to_address>

Sourcery 对开源项目免费 —— 如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In VerticalHeader.vue's onMounted hook, isElectronApp.value is always set to true after the try/catch, which overrides the runtime detection logic and likely forces Electron-only behavior in the browser; this looks unintended and should be removed or guarded.
  • The Resolve tag shell logic is duplicated across multiple jobs in release.yml; consider extracting it into a reusable composite action or a separate step with run: ./scripts/resolve-tag.sh to avoid drift between implementations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `VerticalHeader.vue`'s `onMounted` hook, `isElectronApp.value` is always set to `true` after the try/catch, which overrides the runtime detection logic and likely forces Electron-only behavior in the browser; this looks unintended and should be removed or guarded.
- The `Resolve tag` shell logic is duplicated across multiple jobs in `release.yml`; consider extracting it into a reusable composite action or a separate step with `run: ./scripts/resolve-tag.sh` to avoid drift between implementations.

## Individual Comments

### Comment 1
<location> `dashboard/src/layouts/full/vertical-header/VerticalHeader.vue:384` </location>
<code_context>
+  } catch {
+    isElectronApp.value = false;
+  }
+  isElectronApp.value = true
+});
+
</code_context>

<issue_to_address>
**issue (bug_risk):** Unconditional `isElectronApp = true` overrides the runtime check and likely breaks browser-only behavior.

The runtime check against `window.astrbotDesktop` is immediately overridden by `isElectronApp.value = true`, so all environments are treated as Electron, which can break web deployments.

If this was only for debugging, please remove the forced assignment. Otherwise, keep just the detection logic, e.g.:
```ts
onMounted(async () => {
  try {
    isElectronApp.value = !!window.astrbotDesktop?.isElectron ||
      !!(await window.astrbotDesktop?.isElectronRuntime?.());
  } catch {
    isElectronApp.value = false;
  }
});
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

} catch {
isElectronApp.value = false;
}
isElectronApp.value = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): 无条件设置 isElectronApp = true 会覆盖运行时检查,并很可能破坏仅浏览器环境下的行为。

针对 window.astrbotDesktop 的运行时检查会立即被 isElectronApp.value = true 覆盖,因此所有环境都会被视为 Electron,从而可能破坏 Web 部署。

如果这只是用于调试,请移除这个强制赋值。否则,请仅保留检测逻辑,例如:

onMounted(async () => {
  try {
    isElectronApp.value = !!window.astrbotDesktop?.isElectron ||
      !!(await window.astrbotDesktop?.isElectronRuntime?.());
  } catch {
    isElectronApp.value = false;
  }
});
Original comment in English

issue (bug_risk): Unconditional isElectronApp = true overrides the runtime check and likely breaks browser-only behavior.

The runtime check against window.astrbotDesktop is immediately overridden by isElectronApp.value = true, so all environments are treated as Electron, which can break web deployments.

If this was only for debugging, please remove the forced assignment. Otherwise, keep just the detection logic, e.g.:

onMounted(async () => {
  try {
    isElectronApp.value = !!window.astrbotDesktop?.isElectron ||
      !!(await window.astrbotDesktop?.isElectronRuntime?.());
  } catch {
    isElectronApp.value = false;
  }
});

@dosubot dosubot bot added the feature:updater The bug / feature is about astrbot updater system label Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature:updater The bug / feature is about astrbot updater system size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant