feat(ci): Immutable release#2725
Conversation
Reviewer's Guide将发布工作流重构为单一、参数化的 PR 合并驱动的不可变发布流水线时序图sequenceDiagram
actor Maintainer
participant GitHub as GitHub_PRs
participant Workflow_RT as Workflow_release_trigger
participant Workflow_RP as Workflow_release_publish
participant Job_build as Job_build
participant Job_changelog as Job_changelog
participant Job_rename as Job_rename_and_release
participant Job_publish as Job_publish_draft
participant GHRelease as GitHub_Releases
participant WF_MRCU as Workflow_mirrorchyan_uploading
participant WF_MRCN as Workflow_mirrorchyan_release_note
Maintainer->>GitHub: Merge PR with title release-stable: VERSION or beta-release: VERSION
GitHub-->>Workflow_RT: Trigger on pull_request closed (merged)
Workflow_RT->>Workflow_RT: Extract version and release type from PR title
Workflow_RT->>Workflow_RP: Trigger release-publish.yml with inputs version, configuration, prerelease
Workflow_RP->>Job_build: Start build matrix (configuration, architecture)
Job_build-->>Workflow_RP: Build artifacts uploaded as artifacts
Workflow_RP->>Job_changelog: Generate changelog via git-cliff
Job_changelog->>GHRelease: Create or update draft release with tag vVERSION and body CHANGELOG.md
Workflow_RP->>Job_rename: Start rename_and_release after build and changelog
Job_rename->>Job_rename: Download artifacts and rename to PCL2_CE_configuration_architecture.exe
Job_rename->>Job_rename: Sign binaries with gpg
Job_rename->>GHRelease: Upload binaries and signatures to draft release
Job_rename->>WF_MRCU: Trigger mirrorchyan_uploading.yml with channel and arch
Workflow_RP->>Job_publish: Start publish_draft after rename_and_release
Job_publish->>GHRelease: Publish draft release with tag vVERSION
Job_publish->>WF_MRCN: Trigger mirrorchyan_release_note.yml
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience打开你的 dashboard 来:
Getting HelpOriginal review guide in EnglishReviewer's GuideRefactors the release workflows into a single, parameterized Sequence diagram for PR-merge driven immutable release pipelinesequenceDiagram
actor Maintainer
participant GitHub as GitHub_PRs
participant Workflow_RT as Workflow_release_trigger
participant Workflow_RP as Workflow_release_publish
participant Job_build as Job_build
participant Job_changelog as Job_changelog
participant Job_rename as Job_rename_and_release
participant Job_publish as Job_publish_draft
participant GHRelease as GitHub_Releases
participant WF_MRCU as Workflow_mirrorchyan_uploading
participant WF_MRCN as Workflow_mirrorchyan_release_note
Maintainer->>GitHub: Merge PR with title release-stable: VERSION or beta-release: VERSION
GitHub-->>Workflow_RT: Trigger on pull_request closed (merged)
Workflow_RT->>Workflow_RT: Extract version and release type from PR title
Workflow_RT->>Workflow_RP: Trigger release-publish.yml with inputs version, configuration, prerelease
Workflow_RP->>Job_build: Start build matrix (configuration, architecture)
Job_build-->>Workflow_RP: Build artifacts uploaded as artifacts
Workflow_RP->>Job_changelog: Generate changelog via git-cliff
Job_changelog->>GHRelease: Create or update draft release with tag vVERSION and body CHANGELOG.md
Workflow_RP->>Job_rename: Start rename_and_release after build and changelog
Job_rename->>Job_rename: Download artifacts and rename to PCL2_CE_configuration_architecture.exe
Job_rename->>Job_rename: Sign binaries with gpg
Job_rename->>GHRelease: Upload binaries and signatures to draft release
Job_rename->>WF_MRCU: Trigger mirrorchyan_uploading.yml with channel and arch
Workflow_RP->>Job_publish: Start publish_draft after rename_and_release
Job_publish->>GHRelease: Publish draft release with tag vVERSION
Job_publish->>WF_MRCN: Trigger mirrorchyan_release_note.yml
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - 我发现了 1 个问题,并给出了一些整体性的反馈:
- 在
rename_and_release这个 job 中,shell 赋值语句MRC_CHANNEL = "stable"因为在=两侧有空格而无效,会导致语法错误;应该写成MRC_CHANNEL="stable"(其他类似的赋值语句也需要相应修改)。 - 新增的
release-trigger.ymlworkflow 中调用了gh workflow run,但该 workflow 的permissions目前只授予了contents: read;你很可能需要再添加actions: write(如果需要的话,可能还要加contents: write),这样gh命令才能成功触发另一个 workflow。
给 AI Agent 的提示
请根据以下代码评审意见进行修改:
## 整体评论
- 在 `rename_and_release` 这个 job 中,shell 赋值语句 `MRC_CHANNEL = "stable"` 因为在 `=` 两侧有空格而无效,会导致语法错误;应该写成 `MRC_CHANNEL="stable"`(其他类似的赋值语句也需要相应修改)。
- 新增的 `release-trigger.yml` workflow 中调用了 `gh workflow run`,但该 workflow 的 `permissions` 目前只授予了 `contents: read`;你很可能需要再添加 `actions: write`(如果需要的话,可能还要加 `contents: write`),这样 `gh` 命令才能成功触发另一个 workflow。
## 单独评论
### 评论 1
<location path=".github/workflows/release-trigger.yml" line_range="3-12" />
<code_context>
-name: Publish (Beta)
+name: Release Beta (Actual)
permissions:
- contents: read
+ contents: write
</code_context>
<issue_to_address>
**issue (bug_risk):** 为了让 `gh workflow run` 成功执行,workflow 使用的 token 很可能需要 `actions: write` 权限。
这个 workflow 目前只设置了 `contents: write`,但 `gh workflow run` 需要 `GITHUB_TOKEN` 具备 `actions: write`(在某些配置下还需要 `workflow`)权限。请更新 `permissions` 配置块,至少包含:
```yaml
permissions:
contents: write
actions: write
```
否则 `gh workflow run` 调用很可能会因为权限不足而失败。
</issue_to_address>帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- In the
rename_and_releasejob, the shell assignmentMRC_CHANNEL = "stable"is invalid due to the spaces around=, which will cause a syntax error; it should beMRC_CHANNEL="stable"(and similarly for any other assignments). - The new
release-trigger.ymlworkflow callsgh workflow run, but the workflow’spermissionsonly grantcontents: read; you likely need to addactions: write(and possiblycontents: writeif required) so theghcommand can successfully trigger the other workflow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the `rename_and_release` job, the shell assignment `MRC_CHANNEL = "stable"` is invalid due to the spaces around `=`, which will cause a syntax error; it should be `MRC_CHANNEL="stable"` (and similarly for any other assignments).
- The new `release-trigger.yml` workflow calls `gh workflow run`, but the workflow’s `permissions` only grant `contents: read`; you likely need to add `actions: write` (and possibly `contents: write` if required) so the `gh` command can successfully trigger the other workflow.
## Individual Comments
### Comment 1
<location path=".github/workflows/release-trigger.yml" line_range="3-12" />
<code_context>
-name: Publish (Beta)
+name: Release Beta (Actual)
permissions:
- contents: read
+ contents: write
</code_context>
<issue_to_address>
**issue (bug_risk):** The workflow token likely needs `actions: write` permission for `gh workflow run` to succeed.
This workflow currently only sets `contents: write`, but `gh workflow run` needs `actions: write` on `GITHUB_TOKEN` (and in some setups also `workflow`). Please update the permissions block to include at least:
```yaml
permissions:
contents: write
actions: write
```
Otherwise the `gh workflow run` call is likely to fail with insufficient permissions.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
2eb6785
Add project_file and artifact_name_suffix inputs to the reusable workflow, allowing the build matrix to compile both .csproj and .vbproj targets. Artifact names now include a suffix to distinguish between language variants.
This reverts commit 85e46ae.
|
女娲,推错仓库了( |
已 revert( |
| matrix: | ||
| include: | ||
| - configuration: Beta | ||
| - configuration: ${{ inputs.configuration}} |
There was a problem hiding this comment.
| - configuration: ${{ inputs.configuration}} | |
| - configuration: ${{ inputs.configuration }} |
| - configuration: ${{ inputs.configuration}} | ||
| architecture: x64 | ||
| - configuration: Beta | ||
| - configuration: ${{ inputs.configuration}} |
There was a problem hiding this comment.
| - configuration: ${{ inputs.configuration}} | |
| - configuration: ${{ inputs.configuration }} |
Resolved. As I don't have time to review the rest of this PR, I'm dismissing my self-review to keep the process better organized, rather than submitting an approval.
Summary by Sourcery
引入一个由 PR 标题和草稿版本驱动的、不可变且手动触发的发布工作流,用以取代原有的 beta 和 stable 独立工作流。
新功能:
增强:
softprops/action-gh-release动作,并将发布管理为草稿,待最终发布。CI:
Original summary in English
Summary by Sourcery
Introduce an immutable, manually triggered release workflow driven by PR titles and draft releases, replacing separate beta and stable workflows.
New Features:
Enhancements:
CI: