MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / publish

Function publish

apps/cli/src/build.ts:759–789  ·  view source on GitHub ↗
(channel: string)

Source from the content-addressed store, hash-verified

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

Callers 1

build.tsFile · 0.85

Calls 6

readMetadataFunction · 0.85
variantTagFromVersionFunction · 0.85
publishPackedPackageFunction · 0.85
pushMethod · 0.80
logMethod · 0.80
jsonMethod · 0.65

Tested by

no test coverage detected