feat(v1.16.0): 按依赖顺序将 workspace crate 发布到 crates.io - #95
Merged
Merged
Conversation
为 amber_transpile / amber_sandbox 补齐 path+version 与 crates.io 元数据, 收紧并修正 amberjs 的 include 白名单,并在 Release Assets 中按依赖顺序 幂等发布(已存在版本跳过)。 Co-authored-by: Henry Zhang <hello@zhanghe.dev>
|
本地 cargo publish --dry-run -p amberjs 在 amber_transpile / amber_sandbox 尚未上架时无法解析 version 依赖;Release Assets 会先发布这两个成员。 Co-authored-by: Henry Zhang <hello@zhanghe.dev>
zh30
marked this pull request as ready for review
September 20, 2026 23:56
Merged
zh30
added a commit
that referenced
this pull request
Sep 21, 2026
将 workspace crate 版本从 1.16.0 升到 1.16.1,使 v* 标签检出包含 #95 的 path+version 依赖与按序 crates.io 发布。
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.
变更范围
让 GitHub
v*Release(现有 Release Assets 工作流)能可靠地把 workspace 发布到 crates.io,用户随后可cargo install amberjs得到amber二进制。Cargo.toml的amber_transpile/amber_sandbox同时带path与version = "1.16.0"(与成员 crate 版本一致),否则cargo publish会被 path-only 依赖挡住。crates/amber_transpile、crates/amber_sandbox补齐description、license = "MIT"、repository、readme等 crates.io 字段。extensions/zed(zed-amberjs)保持publish = false,不会发布。include:原先按文件枚举的白名单漏了默认二进制实际编译的大量src/模块,以及include_str!需要的src/web_api/*.js。改为/src/**+/types/**+build.rs/ lock / README / LICENSE / bench 入口。不打包target/、node_modules/、apps/、benchmarks/等大树。打包估算约 2.0MB(crates.io 限 10MB)。CARGO_REGISTRY_TOKEN按序cargo publish -p:amber_transpileamber_sandboxamberjstoken 为空仍跳过并打 warning;版本已存在则视为成功(
workflow_dispatch可重跑);crates.io 故障或索引延迟会重试,仍失败则 publish 步骤失败(Release 本身已经完成)。cargo install amberjs,以及v*+CARGO_REGISTRY_TOKEN驱动 crates.io。影响模块
Cargo.toml、crates/amber_transpile、crates/amber_sandbox.github/workflows/release-assets.ymltests/release_workflow_tests.rsREADME.md、docs/CONTRIBUTING.md、docs/GITHUB_ACTIONS_RUNTIME_INFRASTRUCTURE.md、apps/website/src/docs/installation*.md未改运行时行为,未改版本号。
如何验证
CARGO_REGISTRY_TOKEN已由 Henry 配置,无需新 secret 名。v*标签跑 Release Assets 的workflow_dispatch,或等下一次v*tag。amber_transpile、amber_sandbox)。cargo install amberjs后应得到amber。已跑检查
cargo metadata:path+version^1.16.0;zed-amberjspublish=false。cargo publish -p amber_transpile --dry-run --locked:通过(packaged 10 files, verify compile OK)。cargo publish -p amber_sandbox --dry-run --locked:通过(packaged 8 files, verify compile OK)。cargo package -p amberjs --locked --list --no-verify:694 个文件,含src/lib.rs、src/main.rs、src/web_api/*.js、types/amberjs.d.ts。cargo test --test release_workflow_tests --locked:23 passed。cargo fmt。残留阻塞(已按 cargo 行为处理)
cargo publish -p amberjs --dry-run(即使--no-verify)会在 crates.io 上还没有同版本amber_transpile/amber_sandbox时失败:这是 cargo 把 path+version 依赖改成纯 version 后查 registry 的固有行为,不是清单漏文件。Release Assets 先发布两个成员 crate,并对 “no matching package named” / 已上传版本做重试或跳过,因此正式
v*发布不受影响。未从本 agent 向 crates.io 做真实 publish。相关文档
docs/GITHUB_ACTIONS_RUNTIME_INFRASTRUCTURE.mddocs/INFRASTRUCTURE_CAPABILITY_BACKLOG.md(0.4 crates.io 可见性)docs/CONTRIBUTING.md发布流程