3737
3838 # 1) Validate changesets against base branch
3939 - name : Changeset status
40- run : pnpm changeset status --output .changeset-status.json
40+ run : |
41+ mkdir -p .release-artifacts
42+ pnpm changeset status --output .release-artifacts/changeset-status.json
4143
4244 # 2) Build (same path as production releases)
4345 - name : Build
@@ -62,20 +64,32 @@ jobs:
6264 # 5) Simulate publish by packing all public packages
6365 - name : Pack public packages
6466 run : |
65- mkdir -p .release-artifacts
66- pnpm -r exec -- sh -c '
67- if [ "$(node -p "Boolean(require(\"./package.json\").private)")" = "true" ]; then
68- echo "Skipping private package: $(node -p "require(\"./package.json\").name")"
69- else
70- npm pack --json
71- fi
72- ' > .release-artifacts/pack-output.json 2>&1
67+ node -e '
68+ const fs = require("fs");
69+ const path = require("path");
70+ const { execSync } = require("child_process");
71+ const dirs = fs.readdirSync("packages", { withFileTypes: true })
72+ .filter(d => d.isDirectory())
73+ .map(d => path.join("packages", d.name));
74+ const results = [];
75+ for (const dir of dirs) {
76+ const pkgPath = path.join(dir, "package.json");
77+ if (!fs.existsSync(pkgPath)) continue;
78+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
79+ if (pkg.private) {
80+ console.log("Skipping private package:", pkg.name);
81+ continue;
82+ }
83+ const out = execSync("npm pack --json", { cwd: dir, encoding: "utf8" });
84+ results.push(...JSON.parse(out));
85+ }
86+ fs.writeFileSync(".release-artifacts/pack-output.json", JSON.stringify(results, null, 2));
87+ console.log("Packed", results.length, "packages");
88+ '
7389
7490 - name : Upload preflight artifacts
7591 if : always()
7692 uses : actions/upload-artifact@v4
7793 with :
7894 name : release-preflight-artifacts
79- path : |
80- .changeset-status.json
81- .release-artifacts/pack-output.json
95+ path : .release-artifacts/
0 commit comments