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

Function main

apps/cli/src/release.ts:354–425  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

352};
353
354const main = async () => {
355 const options = parseArgs(process.argv.slice(2));
356 const version = await readVersion();
357 const tag = `v${version}`;
358 const refTag = resolveTagFromEnvironment();
359 const channel = resolveChannel(version);
360
361 validateVersion(version);
362
363 if (refTag && refTag !== tag) {
364 throw new Error(`GitHub tag ${refTag} does not match ${versionPackagePath} version ${version}`);
365 }
366
367 if (options.mode === "publish-only") {
368 await locateBuiltArtifacts(version);
369 await runCommand({
370 command: "bun",
371 args: ["run", "src/build.ts", "publish", channel],
372 cwd: cliRoot,
373 });
374 return;
375 }
376
377 let wrapperArchivePath: string;
378 if (options.skipBuild) {
379 wrapperArchivePath = await locateBuiltArtifacts(version);
380 } else {
381 await rm(releaseDir, { recursive: true, force: true });
382 await mkdir(releaseDir, { recursive: true });
383
384 await runCommand({
385 command: "bun",
386 args: ["run", "src/build.ts", "binary"],
387 cwd: cliRoot,
388 });
389
390 await runCommand({
391 command: "bun",
392 args: ["run", "src/build.ts", "release-assets"],
393 cwd: cliRoot,
394 });
395
396 wrapperArchivePath = await packWrapperPackage();
397 }
398
399 const assetPaths = await collectReleaseAssetPaths(wrapperArchivePath);
400
401 console.log(`Prepared executor@${version} for ${channel}`);
402 for (const assetPath of assetPaths) {
403 console.log(`- ${assetPath}`);
404 }
405
406 if (options.mode === "dry-run") {
407 return;
408 }
409
410 await syncGitHubRelease({
411 tag,

Callers 1

release.tsFile · 0.70

Calls 11

readVersionFunction · 0.85
validateVersionFunction · 0.85
locateBuiltArtifactsFunction · 0.85
packWrapperPackageFunction · 0.85
collectReleaseAssetPathsFunction · 0.85
syncGitHubReleaseFunction · 0.85
logMethod · 0.80
parseArgsFunction · 0.70
resolveChannelFunction · 0.70
runCommandFunction · 0.70

Tested by

no test coverage detected