mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 14:03:52 +00:00
* Add lefthook formatter checks * Fix SDK mode hydration * Stabilize SDK mode integration test
33 lines
1 KiB
TypeScript
33 lines
1 KiB
TypeScript
import * as path from "node:path";
|
|
import { $ } from "execa";
|
|
import type { ReleaseOpts } from "./main";
|
|
import { assertDirExists, PREFIX, uploadDirToReleases } from "./utils";
|
|
|
|
export async function buildJsArtifacts(opts: ReleaseOpts) {
|
|
await buildAndUploadTypescriptSdk(opts);
|
|
}
|
|
|
|
async function buildAndUploadTypescriptSdk(opts: ReleaseOpts) {
|
|
console.log(`==> Building TypeScript SDK`);
|
|
|
|
// Build TypeScript SDK
|
|
await $({
|
|
stdio: "inherit",
|
|
cwd: opts.root,
|
|
})`pnpm --filter sandbox-agent build`;
|
|
|
|
console.log(`✅ TypeScript SDK built successfully`);
|
|
|
|
// Upload TypeScript SDK to R2
|
|
console.log(`==> Uploading TypeScript SDK Artifacts`);
|
|
|
|
const sdkDistPath = path.resolve(opts.root, "sdks/typescript/dist");
|
|
|
|
await assertDirExists(sdkDistPath);
|
|
|
|
// Upload to commit directory
|
|
console.log(`Uploading TypeScript SDK to ${PREFIX}/${opts.commit}/typescript/`);
|
|
await uploadDirToReleases(sdkDistPath, `${PREFIX}/${opts.commit}/typescript/`);
|
|
|
|
console.log(`✅ TypeScript SDK artifacts uploaded successfully`);
|
|
}
|