mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 21:03:26 +00:00
fix: add cli-shared publishing to release workflow
This commit is contained in:
parent
7404e86975
commit
e0573ebaf5
3 changed files with 51 additions and 2 deletions
|
|
@ -133,6 +133,43 @@ export async function publishCrates(opts: ReleaseOpts) {
|
|||
console.log("✅ All crates published");
|
||||
}
|
||||
|
||||
export async function publishNpmCliShared(opts: ReleaseOpts) {
|
||||
const cliSharedPath = join(opts.root, "sdks/cli-shared");
|
||||
const packageJsonPath = join(cliSharedPath, "package.json");
|
||||
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, "utf-8"));
|
||||
const name = packageJson.name;
|
||||
|
||||
// Check if version already exists
|
||||
const versionExists = await npmVersionExists(name, opts.version);
|
||||
if (versionExists) {
|
||||
console.log(
|
||||
`Version ${opts.version} of ${name} already exists. Skipping...`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Build cli-shared
|
||||
console.log(`==> Building @sandbox-agent/cli-shared`);
|
||||
await $({
|
||||
stdio: "inherit",
|
||||
cwd: opts.root,
|
||||
})`pnpm --filter @sandbox-agent/cli-shared build`;
|
||||
|
||||
// Publish
|
||||
console.log(`==> Publishing to NPM: ${name}@${opts.version}`);
|
||||
|
||||
// Add --tag flag for release candidates
|
||||
const isReleaseCandidate = opts.version.includes("-rc.");
|
||||
const tag = isReleaseCandidate ? "rc" : "latest";
|
||||
|
||||
await $({
|
||||
stdio: "inherit",
|
||||
cwd: cliSharedPath,
|
||||
})`pnpm publish --access public --tag ${tag} --no-git-checks`;
|
||||
|
||||
console.log(`✅ Published ${name}@${opts.version}`);
|
||||
}
|
||||
|
||||
export async function publishNpmSdk(opts: ReleaseOpts) {
|
||||
const sdkPath = join(opts.root, "sdks/typescript");
|
||||
const packageJsonPath = join(sdkPath, "package.json");
|
||||
|
|
@ -148,7 +185,7 @@ export async function publishNpmSdk(opts: ReleaseOpts) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Build the SDK
|
||||
// Build the SDK (cli-shared should already be built by publishNpmCliShared)
|
||||
console.log(`==> Building TypeScript SDK`);
|
||||
await $({
|
||||
stdio: "inherit",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue