chore(ci): publish package previews - #370
Conversation
commit: |
chenjiahan
left a comment
There was a problem hiding this comment.
Requesting changes because the published rstack preview is not release-equivalent.
[P1] Publish native packages with the preview
In .github/workflows/pkg-pr-new.yml:31, the invocation publishes only the two JS package directories. The preceding root build does not run the NAPI build/assembly or napi pre-publish, so the actual rstack@4b142ab archive contains binding.cjs but neither a .node artifact nor any @rstackjs/cli-* optional dependencies. A clean install fails with Cannot find native binding as soon as rs fmt loads a .gitignore or --ignore-path. Please reuse the native release assembly flow, inject the preview native dependencies, and publish those packages in the same invocation.
[P2] Stage bundled docs before packing
In .github/workflows/pkg-pr-new.yml:28, node --run build does not populate packages/rstack/docs, which is generated and ignored. The production release runs node --run release:prepare; this preview tarball consequently has no docs/ or docs/llms.txt. Please run release preparation, or equivalent docs staging, before publishing.
[P3] Remove the string-based workflow test
packages/rstack/tests/pkgPrNew.test.ts duplicates workflow text without validating behavior: comments could satisfy the assertions, a routine pkg-pr-new upgrade requires test churn, and it remains green while the published archive is missing native bindings and docs. The workflow run already validates the wiring. Please remove this test; if regression coverage is desired, add a post-publish smoke test that installs the emitted URL and runs representative rstack and create-rstack commands.
Trigger timing
The current pre-merge pull_request trigger targeting main is appropriate for a PR preview. I would not defer it until merge; a separate push trigger on main can provide post-merge snapshots. As optional CI optimizations, skip draft PRs and add per-PR concurrency with cancellation of superseded runs.
Verification: I inspected https://pkg.pr.new/rstack@4b142ab and reproduced the native binding failure from a clean install.
This PR enables pkg.pr.new previews for
rstackandcreate-rstackso pull requests can be tested through installable package URLs before release.It installs the publisher from the workspace lockfile, builds both packages, and publishes them in one pnpm-aware workflow invocation. The workflow is ready while the pkg.pr.new GitHub App access request is awaiting approval.