Skip to content

feat(release): split updater manifest by channel from tag suffix#330

Merged
appergb merged 1 commit into
betafrom
feat/release-channels-ci
May 7, 2026
Merged

feat(release): split updater manifest by channel from tag suffix#330
appergb merged 1 commit into
betafrom
feat/release-channels-ci

Conversation

@appergb
Copy link
Copy Markdown
Collaborator

@appergb appergb commented May 7, 2026

User description

Summary

让 release pipeline 根据 tag 后缀区分 Beta / 正式版渠道。这是 opt-in Beta 机制的服务端基础——客户端按渠道选 endpoint 的代码在 PR-B-2 中接入。

约定(这套机制的全部行为都建立在这一行规则上)

Tag pattern 渠道 GitHub Release Manifest 文件名
`v-tauri` stable 正式(prerelease=false) `latest-{tgt}-{arch}.json`(旧文件名,不变)
`v-beta-tauri` beta prerelease=true `latest-{tgt}-{arch}-beta.json`(新增)

正式版用户的 endpoint 永远指向不带后缀的 `latest-{tgt}-{arch}.json`,beta release 不会覆盖这个文件——这是「Beta 不溢出正式版」的物理隔离基础。

改动

`.github/workflows/release-tauri.yml`

  • `jobs.build` 顶层加 `OPENLESS_RELEASE_CHANNEL` env,由 `endsWith(github.ref_name, '-beta-tauri')` 判定。workflow_dispatch / 非 tag 触发回退 stable,现有 dispatch 行为不变
  • Write updater manifest step 把渠道透传给脚本
  • Upload-artifact 的 manifest path 由两条具体文件名改成 `latest-{tgt}-{arch}*.json` glob,让 stable 和 beta 两种文件名(含 mirror 变体)都能被收集
  • Create release 的 `prerelease` 从硬编码 `false` 改为 `${{ env.OPENLESS_RELEASE_CHANNEL == 'beta' }}`

`openless-all/app/scripts/write-updater-manifest.mjs`

  • 读取 `OPENLESS_RELEASE_CHANNEL`(默认 stable);非 `stable` / `beta` 时 fail-fast,避免拼错 env 静默走错路径
  • beta 渠道时输出 `latest-{tgt}-{arch}-beta.json` + `-beta-mirror.json`;stable 沿用旧文件名

向后兼容

  • 现有 `v1.2.23-tauri` 等 stable release 的所有行为完全不变(文件名、prerelease=false、上传清单都沿用旧逻辑)
  • workflow_dispatch 不打 tag 时照常构建 + 不上传 release
  • Tauri updater 的 endpoints(`tauri.conf.json` 里的 `latest-{{target}}-{{arch}}.json`)暂时不动,依然指向 stable manifest——这是 PR-B-2 才会调整的部分

本地烟囱测试

```bash

不合法值:fail-fast

OPENLESS_UPDATE_TARGET=darwin OPENLESS_UPDATE_ARCH=aarch64 \
OPENLESS_RELEASE_CHANNEL=invalid \
node openless-all/app/scripts/write-updater-manifest.mjs

→ Error: Invalid OPENLESS_RELEASE_CHANNEL: "invalid" (expected "stable" or "beta")

合法值或不设:进入正常 artifact 解析路径(本地无 build artifact 时报 No updater artifact found,符合预期)

```

Test plan

  • PR-A (docs: introduce Beta/Stable two-channel branching workflow #327) merge 后,本 PR 可独立 merge(两者无文件冲突)
  • 与 PR-B-2 一并 merge 后,推一个 `v-beta-tauri` tag:
    • GitHub Release 应标为 prerelease(页面标题旁有 "Pre-release" 标签)
    • Release assets 中有 `latest-{tgt}-{arch}-beta.json` + `-beta-mirror.json`,没有不带后缀的 `latest-*.json`
  • 反之推 `v-tauri` stable tag:
    • 标为正式 release(无 Pre-release 标签)
    • Release assets 含 `latest-{tgt}-{arch}.json` + `-mirror.json`,含 `-beta` 变体
  • 现有 stable 用户的 in-app 「检查更新」行为不变(endpoint 指向旧文件名)

PR Type

Enhancement


Description

  • Support beta channel releases via -beta-tauri tag suffix

  • Generate -beta suffix in updater manifest filenames for beta

  • Mark beta GitHub Releases as prerelease to hide from stable users

  • Switch artifact upload paths to glob to capture both channel manifests


Diagram Walkthrough

flowchart LR
  beta_tag["Tag v*-beta-tauri"] --> channel_beta["Channel: beta"]
  stable_tag["Tag v*-tauri"] --> channel_stable["Channel: stable"]
  channel_beta --> manifest_beta["Write manifest\nlatest-*-beta.json"]
  channel_stable --> manifest_stable["Write manifest\nlatest-*.json (unchanged)"]
  manifest_beta --> upload["Artifact glob: *.json"]
  manifest_stable --> upload
  upload --> release["Create Release\nprerelease=(channel==beta)"]
Loading

File Walkthrough

Relevant files
Enhancement
release-tauri.yml
Add beta channel support to release CI                                     

.github/workflows/release-tauri.yml

  • Added job-level env to derive channel from tag suffix
  • Pass channel env to write-updater-manifest step
  • Changed manifest artifact upload paths to glob to include beta files
  • Set GitHub Release prerelease flag based on channel
+17/-7   
write-updater-manifest.mjs
Add beta channel suffix to updater manifest                           

openless-all/app/scripts/write-updater-manifest.mjs

  • Read and validate OPENLESS_RELEASE_CHANNEL (stable/beta)
  • Append -beta suffix to manifest filenames for beta channel
  • Stable channel filenames remain unchanged for backward compatibility
+9/-2     

让 release pipeline 根据 tag 名后缀区分 Beta / 正式版渠道,是 opt-in beta
机制的服务端基础。客户端读取的 endpoint 在 PR-B-2 接入。

约定:
- `v<v>-tauri`           = 正式版渠道(stable)
- `v<v>-beta-tauri`      = Beta 渠道(beta)

release-tauri.yml 改动:
- 在 jobs.build 顶层加 OPENLESS_RELEASE_CHANNEL job-env,由
  endsWith(github.ref_name, '-beta-tauri') 决定;workflow_dispatch 与
  非 tag 触发回退为 stable,不改变现有 dispatch 行为。
- Write updater manifest step 把 OPENLESS_RELEASE_CHANNEL 透传给脚本。
- Upload-artifact 的 manifest path 改为 `latest-{tgt}-{arch}*.json` glob,
  让 stable 和 beta 两种文件名(或 mirror 变体)都能被收集,避免
  if-no-files-found 在 beta release 时挂掉。
- Create release 的 prerelease 改为
  `${{ env.OPENLESS_RELEASE_CHANNEL == 'beta' }}`:beta tag 自动标
  GitHub prerelease(UI 折叠 + 默认不算 latest),stable 保持不变。

write-updater-manifest.mjs 改动:
- 读取 OPENLESS_RELEASE_CHANNEL(默认 stable);非 stable / beta 时
  fail-fast,避免拼错 env 静默走错路径。
- beta 渠道时 manifest 文件名加 `-beta` 后缀:
    latest-{tgt}-{arch}-beta.json
    latest-{tgt}-{arch}-beta-mirror.json
  正式版用户的 endpoint 永远指向不带后缀的旧文件名,不会被 beta release 覆盖。

向后兼容:
- 现有 v1.2.23-tauri 等 stable release 行为完全不变(文件名、prerelease=false 沿用旧逻辑)。
- workflow_dispatch 不打 tag 时也照常构建 + 不上传 release。

发版后 checklist(PR-B-2 文档段会写进 CLAUDE.md):
- 推 v<v>-beta-tauri tag → GitHub Release 应标 prerelease 且只含
  latest-*-beta.json
- 推 v<v>-tauri tag → 正式 release 且只含 latest-*.json(不带后缀)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b10ae9da5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +33 to +34
env:
OPENLESS_RELEASE_CHANNEL: ${{ endsWith(github.ref_name, '-beta-tauri') && 'beta' || 'stable' }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Merge the channel into the existing job env

This adds a second env: mapping under the same jobs.build object, while the workflow already has another job-level env below runs-on for the Tauri signing secrets. YAML cannot keep both mappings for the same key (parsers either reject the workflow or keep only one; e.g. the later block drops this OPENLESS_RELEASE_CHANNEL value), so a v*-beta-tauri run will not propagate beta to the manifest step and prerelease evaluates false. Put this variable into the existing job env block instead.

Useful? React with 👍 / 👎.

const assetName = basename(artifact);
const manifestName = `latest-${target}-${arch}.json`;
const mirrorManifestName = `latest-${target}-${arch}-mirror.json`;
const manifestName = `latest-${target}-${arch}${channelSuffix}.json`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid releases/latest for beta manifests

When channelSuffix is -beta, this creates a manifest intended to live on a GitHub prerelease, but the url written just below still uses /releases/latest/download/.... GitHub's latest download route resolves to the latest non-prerelease release, so a beta manifest fetched from a prerelease would point users at the stable asset (and a beta endpoint using latest/download/latest-...-beta.json would not find the prerelease manifest). Beta artifacts need tag-specific or otherwise beta-specific download URLs instead of the global latest route.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ❌

327 - Not compliant

Non-compliant requirements:

  • Contribution docs were not updated in this PR.
  • CLAUDE.md was not updated in this PR.
  • CI branch triggers were not updated in this PR.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Beta URL mismatch

The generated beta manifest still builds download links from the releases/latest/download endpoint. GitHub's latest download path skips prereleases, so a beta manifest would resolve to the last stable release instead of the beta build that produced it. Once beta releases are marked prerelease, beta users would not actually receive the channel-specific binaries.

const githubAssetUrl = `https://github.com/${repo}/releases/latest/download/${assetName}`;
const mirrorAssetUrl = `${mirrorBaseUrl.replace(/\/$/, '')}/${repo}/releases/latest/download/${assetName}`;

@appergb appergb merged commit ec9584e into beta May 7, 2026
4 checks passed
@appergb appergb deleted the feat/release-channels-ci branch May 7, 2026 14:00
appergb added a commit that referenced this pull request May 7, 2026
…ml (#335)

PR #330 在 jobs.build 顶层多加了一个 env: 块来定义 OPENLESS_RELEASE_CHANNEL,
但下面 strategy/runs-on 之后已经有一个 env: 块(TAURI_SIGNING_PRIVATE_KEY 等)。
YAML map 不允许重复 key——GitHub Actions 解析直接 fail,整条 release-tauri.yml
工作流变成 "workflow file issue" 启动失败。

修复:把 OPENLESS_RELEASE_CHANNEL 并到下面那个唯一的 env: 块里,保留完整注释。

校验:
- python -c "yaml.safe_load(...)" 解析成功
- jobs.build.env 现在有 3 个 key: OPENLESS_RELEASE_CHANNEL, TAURI_SIGNING_PRIVATE_KEY,
  TAURI_SIGNING_PRIVATE_KEY_PASSWORD

Co-authored-by: baiqing <lbx12309@icloud.com>
appergb added a commit that referenced this pull request May 7, 2026
PR #330 在 jobs.build 顶层多加了一个 env: 块来定义 OPENLESS_RELEASE_CHANNEL,
但下面 strategy/runs-on 之后已经有一个 env: 块(TAURI_SIGNING_PRIVATE_KEY 等)。
YAML map 不允许重复 key——GitHub Actions 解析直接 fail,整条 release-tauri.yml
工作流变成 "workflow file issue" 启动失败。

修复:把 OPENLESS_RELEASE_CHANNEL 并到下面那个唯一的 env: 块里,保留完整注释。

校验:
- python -c "yaml.safe_load(...)" 解析成功
- jobs.build.env 现在有 3 个 key: OPENLESS_RELEASE_CHANNEL, TAURI_SIGNING_PRIVATE_KEY,
  TAURI_SIGNING_PRIVATE_KEY_PASSWORD

Co-authored-by: baiqing <lbx12309@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant