@icebreakers/monorepo-templates 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,6 +35,10 @@ on:
|
|
|
35
35
|
required: false
|
|
36
36
|
default: false
|
|
37
37
|
type: boolean
|
|
38
|
+
source-sha:
|
|
39
|
+
description: Original main commit to recover (publish modes only)
|
|
40
|
+
required: false
|
|
41
|
+
type: string
|
|
38
42
|
|
|
39
43
|
env:
|
|
40
44
|
HUSKY: 0
|
|
@@ -104,6 +108,7 @@ jobs:
|
|
|
104
108
|
REPO_RELEASE_PACKAGE: ${{ inputs.package }}
|
|
105
109
|
REPO_RELEASE_VERSION: ${{ inputs.version }}
|
|
106
110
|
REPO_RELEASE_DRY_RUN: ${{ inputs.dry-run }}
|
|
111
|
+
REPO_RELEASE_RECOVERY_SOURCE_SHA: ${{ inputs.source-sha }}
|
|
107
112
|
run: pnpm exec repo release ci
|
|
108
113
|
|
|
109
114
|
- name: Preserve npm publish progress
|
package/package.json
CHANGED
|
@@ -64,6 +64,24 @@ If a runner disappears during upload before responses are persisted, recovery pe
|
|
|
64
64
|
|
|
65
65
|
Legacy injected `GitHubOperations` adapters retain their previous behavior. Recovery-capable adapters must implement `readReleaseState`, `writeReleaseState`, `listReleases`, and `ensureTag`; `readTagTarget` is recommended. Enforce revision comparison on writes and throw on query errors. A local summary is not a remote checkpoint.
|
|
66
66
|
|
|
67
|
+
## No-release intents and original-source recovery
|
|
68
|
+
|
|
69
|
+
An intent containing only `none` (or empty frontmatter) records that no release is needed. It does not open a version PR or block publishing an already prepared release. Consumed intents resurrected by a merge are not versioned twice. pnpm cleans these files during the next effective version operation.
|
|
70
|
+
|
|
71
|
+
Release PRs use the applied package list returned by pnpm, not arbitrary Git changes. A new package can keep its initial version; it still appears in the release notes. Cleanup alone never opens a release PR.
|
|
72
|
+
|
|
73
|
+
If an existing prepared version has not completed publication, new version preparation stops before consuming intents and prints its source commit and recovery command. Finish that release first, then run preparation again:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
repo release ci --mode publish --source-sha <full-main-commit-sha> --dry-run
|
|
77
|
+
repo release ci --mode publish --source-sha <full-main-commit-sha>
|
|
78
|
+
repo release ci --mode prepare
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The managed Release workflow exposes the same `source-sha` input for `publish` and `publish-unpublished`. Current tooling checks out the original commit into an isolated directory, installs its locked dependencies, builds and verifies that source, and recovers the full set of versions introduced by its manifests or ledger, including dependency propagation. Package/version inputs validate membership; they do not split the original release. The SHA must belong to `origin/main`. Dry-run only inspects the source and remote release state; it does not install, upload, run hooks, or write checkpoints. Later changes stay pending for a new version. The original source must already include all intended version changes; no versions are changed during recovery.
|
|
82
|
+
|
|
83
|
+
Recovery preserves GitHub's workflow environment for trusted publishing and provenance: its signed identity refers to the workflow run's commit. The isolated checkout, release checkpoint, Git tags, and Release targets refer to `source-sha`. Do not overwrite `GITHUB_SHA` to recover an older source; npm rejects provenance that disagrees with the signed workflow identity.
|
|
84
|
+
|
|
67
85
|
## Next
|
|
68
86
|
|
|
69
87
|
Read [publishing and changelogs](/learn/monorepo/publish) for repository policy and [reports and output](/tasks/reports) for CI artifacts.
|
|
@@ -70,6 +70,24 @@ const hook = { script: 'publish:extension', idempotent: true }
|
|
|
70
70
|
|
|
71
71
|
程序化注入的旧 `GitHubOperations` adapter 保留原行为;要启用跨 runner 恢复,需要实现 `readReleaseState`、`writeReleaseState`、`listReleases`、`ensureTag`,并建议提供 `readTagTarget`。写入必须校验 revision,查询错误必须抛出。仅有本地 summary 不能代替远端检查点。
|
|
72
72
|
|
|
73
|
+
## 无需发布的记录与原提交恢复
|
|
74
|
+
|
|
75
|
+
仅包含 `none` 或空 frontmatter 的 intent 表示无需发布。它不会创建版本 PR,也不阻断已经准备好的版本发布。合并后重新出现、但 ledger 已记录消费的 intent 不会再次升级版本;pnpm 会在下一次有效版本操作中清理这些文件。
|
|
76
|
+
|
|
77
|
+
版本 PR 以 pnpm 返回的实际发布包列表为依据,不再把任意 Git 改动视为版本变化。新包首次发布可以保留初始版本号,但仍会列入发布说明。仅清理记录不会创建发布 PR。
|
|
78
|
+
|
|
79
|
+
已有版本尚未完成发布时,新的版本准备会在消费 intent 前失败,并给出原始提交和恢复命令。先恢复旧发布,再准备新版本:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
repo release ci --mode publish --source-sha <完整的-main-提交-SHA> --dry-run
|
|
83
|
+
repo release ci --mode publish --source-sha <完整的-main-提交-SHA>
|
|
84
|
+
repo release ci --mode prepare
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
受管 Release 工作流为 `publish` 和 `publish-unpublished` 提供相同的 `source-sha` 输入。当前工具会在独立目录检出原提交,按照其锁文件安装、构建和验证,恢复该提交 manifest 或 ledger 新增的整批版本,包括依赖传播升级的包。package/version 输入只校验是否属于该批发布,不拆分原发布批次。SHA 必须属于 `origin/main` 历史。dry-run 只检查源码与远端状态,不安装、不上传、不运行 hook、不写检查点。后续变更保留到下一版本;恢复过程中不修改版本号。
|
|
88
|
+
|
|
89
|
+
恢复保留 GitHub 工作流环境,供可信发布和 provenance 使用:签名身份对应运行工作流的提交;独立检出的源码、发布检查点、Git tag 和 Release 目标则对应 `source-sha`。不要通过覆盖 `GITHUB_SHA` 恢复旧源码,npm 会拒绝与工作流签名身份不一致的 provenance。
|
|
90
|
+
|
|
73
91
|
## 下一步
|
|
74
92
|
|
|
75
93
|
阅读[发包与变更日志](/zh/learn/monorepo/publish),再查看[报告与输出](/zh/tasks/reports)了解 CI 产物。
|