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

Function publish

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

Source from the content-addressed store, hash-verified

837};
838
839const publish = async (channel: string) => {
840 const meta = await readMetadata();
841
842 // Variants publish first so the wrapper's optionalDependencies resolve.
843 // All variants and the wrapper publish to the same npm package
844 // (`executor`) — variants under platform-tagged versions, wrapper under
845 // the channel tag. Single trusted-publishing config covers everything.
846 const platformDirs: string[] = [];
847 for (const entry of new Bun.Glob("executor-*/package.json").scanSync({ cwd: distDir })) {
848 platformDirs.push(join(distDir, dirname(entry)));
849 }
850 platformDirs.sort();
851
852 // Publish variants sequentially. They all PUT to the same npm package
853 // (`executor`), and the registry rejects concurrent packument updates with
854 // 409 Conflict ("Failed to save packument. A common cause is if you try to
855 // publish a new package before the previous package has been fully
856 // processed.") — that's exactly what happened on v1.4.14's first attempt,
857 // where 3 of 8 raced through and the rest 409'd. Serial is plenty fast
858 // (~5s per variant × 8 ≈ 40s).
859 console.log(`Publishing ${platformDirs.length} platform variant(s)...`);
860 for (const dir of platformDirs) {
861 const pkg = (await Bun.file(join(dir, "package.json")).json()) as { version: string };
862 const tag = variantTagFromVersion(pkg.version);
863 await publishPackedPackage(dir, tag);
864 }
865
866 const wrapperDir = join(distDir, meta.name);
867 console.log(`Publishing wrapper ${wrapperDir} under @${channel}...`);
868 await publishPackedPackage(wrapperDir, channel);
869};
870
871// ---------------------------------------------------------------------------
872// 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