(channel: string)
| 766 | }; |
| 767 | |
| 768 | const publish = async (channel: string) => { |
| 769 | const meta = await readMetadata(); |
| 770 | |
| 771 | // Variants publish first so the wrapper's optionalDependencies resolve. |
| 772 | // All variants and the wrapper publish to the same npm package |
| 773 | // (`executor`) — variants under platform-tagged versions, wrapper under |
| 774 | // the channel tag. Single trusted-publishing config covers everything. |
| 775 | const platformDirs: string[] = []; |
| 776 | for (const entry of new Bun.Glob("executor-*/package.json").scanSync({ cwd: distDir })) { |
| 777 | platformDirs.push(join(distDir, dirname(entry))); |
| 778 | } |
| 779 | platformDirs.sort(); |
| 780 | |
| 781 | // Publish variants sequentially. They all PUT to the same npm package |
| 782 | // (`executor`), and the registry rejects concurrent packument updates with |
| 783 | // 409 Conflict ("Failed to save packument. A common cause is if you try to |
| 784 | // publish a new package before the previous package has been fully |
| 785 | // processed.") — that's exactly what happened on v1.4.14's first attempt, |
| 786 | // where 3 of 8 raced through and the rest 409'd. Serial is plenty fast |
| 787 | // (~5s per variant × 8 ≈ 40s). |
| 788 | console.log(`Publishing ${platformDirs.length} platform variant(s)...`); |
| 789 | for (const dir of platformDirs) { |
| 790 | const pkg = (await Bun.file(join(dir, "package.json")).json()) as { version: string }; |
| 791 | const tag = variantTagFromVersion(pkg.version); |
| 792 | await publishPackedPackage(dir, tag); |
| 793 | } |
| 794 | |
| 795 | const wrapperDir = join(distDir, meta.name); |
| 796 | console.log(`Publishing wrapper ${wrapperDir} under @${channel}...`); |
| 797 | await publishPackedPackage(wrapperDir, channel); |
| 798 | }; |
| 799 | |
| 800 | // --------------------------------------------------------------------------- |
| 801 | // GitHub release assets |
no test coverage detected