fix(maker): publish beta packages as prereleases#249
Merged
Conversation
- Change Maker auto versioning so beta, alpha, and next tags publish prerelease versions. - Base prerelease versions on the highest published stable version, then increment the tag number. - Keep latest releases on stable patch versions so beta testing no longer consumes release numbers. - Update Maker release workflow docs and add coverage for prerelease and stable promotion paths. - Verified with npm test, npm run lint, npm run format:check, and touched-file Prettier checks.
|
| Filename | Overview |
|---|---|
| scripts/resolve-maker-version.js | 核心版本解析脚本:新增 resolvePrereleaseAutoVersion、maxStableCore、maxPrereleaseNumberForBase 等函数,将 beta/alpha/next tag 的自动模式路由至 prerelease 路径;stable tag 逻辑不变。逻辑正确,边界情况有测试覆盖。 |
| src/tests/makerVersionPolicy.test.ts | 测试文件全面更新:新增 prerelease 路径的多个用例(首次发布、递增编号、跨 major/minor 最高稳定线、alpha/next 语义),并添加 dist-tag 查询次数限制的测试。 |
| .github/workflows/publish-maker.yml | 仅更新 version_mode 参数描述文案,workflows 结构和 Actions 引用(checkout@v4、setup-node@v4)均使用语义版本 tag,符合仓库规范。 |
| docs/CI_CD.md | 文档更新与新版本策略一致:说明 tag=latest 递增 stable patch,tag=beta/alpha/next 发布 prerelease,举例了完整的 beta→stable 促进流程。 |
| docs/MAKER.md | 文档更新与 CI_CD.md 保持一致,说明 prerelease 版本基于最高稳定版本生成,避免 beta 测试消耗正式版本号。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[resolveAutoVersion] -->|tag in PRERELEASE_TAGS\nbeta / alpha / next| B[resolvePrereleaseAutoVersion]
A -->|tag = latest\nor other stable tags| C[resolveStableAutoVersion]
B --> D[maxStableCore\n获取全局最高稳定版本]
D --> E{highestStableCore\n>= currentCore?}
E -->|Yes| F[nextBase = highestStable + 1\n如 0.0.16 → 0.0.17]
E -->|No| G[nextBase = currentCore\n如 0.0.17-beta.x → 0.0.17]
F --> H[maxPrereleaseNumberForBase\n查找已发布的最大编号]
G --> H
H --> I[next = baseVersion-tag.number+1\n如 0.0.17-beta.1]
C --> J[assertStableThreeSegmentVersion\ncurrentVersion]
J --> K[maxStablePatchForCurrentLine\n同 major/minor 最高稳定 patch]
K --> L[incrementFinalNumber\n如 0.0.16 → 0.0.17]
Reviews (2): Last reviewed commit: "test(maker): cover prerelease review fee..." | Re-trigger Greptile
- Add alpha and next auto-version coverage for prerelease publishing. - Assert auto mode only queries the current dist-tag once. - Document the sync requirement between prerelease tags and workflow choices. - Reuse the current dist-tag version already read by main instead of querying npm again. - Verified with npm test, npm run lint, npm run format:check, and touched-file Prettier checks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test Plan