mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 06:04:43 +00:00
chore: fix bad merge
This commit is contained in:
parent
1dd45908a3
commit
94353f7696
205 changed files with 19244 additions and 14866 deletions
|
|
@ -36,6 +36,7 @@ export async function tagDocker(opts: ReleaseOpts) {
|
|||
// Create and push manifest with latest
|
||||
if (opts.latest) {
|
||||
await createManifest(sourceCommit, "latest");
|
||||
await createManifest(sourceCommit, opts.minorVersionChannel);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export interface ReleaseOpts {
|
|||
root: string;
|
||||
version: string;
|
||||
latest: boolean;
|
||||
minorVersionChannel: string;
|
||||
/** Commit to publish release for. */
|
||||
commit: string;
|
||||
/** Optional version to reuse artifacts and Docker images from instead of building. */
|
||||
|
|
@ -434,6 +435,10 @@ async function main() {
|
|||
console.log(`Auto-determined latest flag: ${isLatest} (version: ${version})`);
|
||||
}
|
||||
|
||||
const parsedVersion = semver.parse(version);
|
||||
assert(parsedVersion !== null, "version must be parseable");
|
||||
const minorVersionChannel = `${parsedVersion.major}.${parsedVersion.minor}.x`;
|
||||
|
||||
// Setup opts
|
||||
let commit: string;
|
||||
if (opts.overrideCommit) {
|
||||
|
|
@ -449,6 +454,7 @@ async function main() {
|
|||
root: ROOT_DIR,
|
||||
version: version,
|
||||
latest: isLatest,
|
||||
minorVersionChannel,
|
||||
commit,
|
||||
reuseEngineVersion: opts.reuseEngineVersion,
|
||||
};
|
||||
|
|
@ -469,6 +475,7 @@ async function main() {
|
|||
console.log(`\nRelease Details:`);
|
||||
console.log(` Version: ${releaseOpts.version}`);
|
||||
console.log(` Latest: ${releaseOpts.latest}`);
|
||||
console.log(` Minor channel: ${releaseOpts.minorVersionChannel}`);
|
||||
console.log(` Commit: ${releaseOpts.commit}`);
|
||||
if (releaseOpts.reuseEngineVersion) {
|
||||
console.log(` Reusing engine version: ${releaseOpts.reuseEngineVersion}`);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ export async function promoteArtifacts(opts: ReleaseOpts) {
|
|||
await uploadInstallScripts(opts, opts.version);
|
||||
if (opts.latest) {
|
||||
await uploadInstallScripts(opts, "latest");
|
||||
await uploadInstallScripts(opts, opts.minorVersionChannel);
|
||||
}
|
||||
|
||||
// Upload gigacode install scripts
|
||||
|
|
@ -97,5 +98,23 @@ async function promotePath(opts: ReleaseOpts, sourceCommit: string, name: string
|
|||
await copyPath(sourcePrefix, `${PREFIX}/${opts.version}/${name}/`);
|
||||
if (opts.latest) {
|
||||
await copyPath(sourcePrefix, `${PREFIX}/latest/${name}/`);
|
||||
if (name === "binaries") {
|
||||
const binariesSourcePrefix = `${PREFIX}/${sourceCommit}/binaries/sandbox-agent-`;
|
||||
const sandboxAgentBinaries = await listReleasesObjects(binariesSourcePrefix);
|
||||
if (
|
||||
!Array.isArray(sandboxAgentBinaries?.Contents) ||
|
||||
sandboxAgentBinaries.Contents.length === 0
|
||||
) {
|
||||
throw new Error(`No sandbox-agent binaries found under ${binariesSourcePrefix}`);
|
||||
}
|
||||
|
||||
await copyPath(
|
||||
binariesSourcePrefix,
|
||||
`${PREFIX}/${opts.minorVersionChannel}/binaries/sandbox-agent-`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await copyPath(sourcePrefix, `${PREFIX}/${opts.minorVersionChannel}/${name}/`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,13 +228,17 @@ export async function publishNpmCliShared(opts: ReleaseOpts) {
|
|||
|
||||
// Add --tag flag for release candidates
|
||||
const isReleaseCandidate = opts.version.includes("-rc.");
|
||||
const tag = isReleaseCandidate ? "rc" : "latest";
|
||||
const tag = isReleaseCandidate ? "rc" : (opts.latest ? "latest" : opts.minorVersionChannel);
|
||||
|
||||
await $({
|
||||
stdio: "inherit",
|
||||
cwd: cliSharedPath,
|
||||
})`pnpm publish --access public --tag ${tag} --no-git-checks`;
|
||||
|
||||
if (opts.latest && tag === "latest") {
|
||||
await addNpmDistTag(name, opts.version, opts.minorVersionChannel);
|
||||
}
|
||||
|
||||
console.log(`✅ Published ${name}@${opts.version}`);
|
||||
}
|
||||
|
||||
|
|
@ -265,13 +269,17 @@ export async function publishNpmSdk(opts: ReleaseOpts) {
|
|||
|
||||
// Add --tag flag for release candidates
|
||||
const isReleaseCandidate = opts.version.includes("-rc.");
|
||||
const tag = isReleaseCandidate ? "rc" : "latest";
|
||||
const tag = isReleaseCandidate ? "rc" : (opts.latest ? "latest" : opts.minorVersionChannel);
|
||||
|
||||
await $({
|
||||
stdio: "inherit",
|
||||
cwd: sdkPath,
|
||||
})`pnpm publish --access public --tag ${tag} --no-git-checks`;
|
||||
|
||||
if (opts.latest && tag === "latest") {
|
||||
await addNpmDistTag(name, opts.version, opts.minorVersionChannel);
|
||||
}
|
||||
|
||||
console.log(`✅ Published ${name}@${opts.version}`);
|
||||
}
|
||||
|
||||
|
|
@ -346,7 +354,12 @@ export async function publishNpmCli(opts: ReleaseOpts) {
|
|||
|
||||
// Add --tag flag for release candidates
|
||||
const isReleaseCandidate = opts.version.includes("-rc.");
|
||||
const tag = isReleaseCandidate ? "rc" : "latest";
|
||||
const tag = getCliPackageNpmTag({
|
||||
packageName,
|
||||
isReleaseCandidate,
|
||||
latest: opts.latest,
|
||||
minorVersionChannel: opts.minorVersionChannel,
|
||||
});
|
||||
|
||||
try {
|
||||
await $({
|
||||
|
|
@ -354,6 +367,14 @@ export async function publishNpmCli(opts: ReleaseOpts) {
|
|||
cwd: packagePath,
|
||||
})`pnpm publish --access public --tag ${tag} --no-git-checks`;
|
||||
console.log(`✅ Published ${packageName}@${opts.version}`);
|
||||
|
||||
if (
|
||||
opts.latest &&
|
||||
tag === "latest" &&
|
||||
isSandboxAgentCliPackage(packageName)
|
||||
) {
|
||||
await addNpmDistTag(packageName, opts.version, opts.minorVersionChannel);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`❌ Failed to publish ${packageName}`);
|
||||
throw err;
|
||||
|
|
@ -362,3 +383,35 @@ export async function publishNpmCli(opts: ReleaseOpts) {
|
|||
|
||||
console.log("✅ All CLI packages published");
|
||||
}
|
||||
|
||||
function getCliPackageNpmTag(opts: {
|
||||
packageName: string;
|
||||
isReleaseCandidate: boolean;
|
||||
latest: boolean;
|
||||
minorVersionChannel: string;
|
||||
}): string {
|
||||
if (opts.isReleaseCandidate) {
|
||||
return "rc";
|
||||
}
|
||||
|
||||
if (opts.latest) {
|
||||
return "latest";
|
||||
}
|
||||
|
||||
return opts.minorVersionChannel;
|
||||
}
|
||||
|
||||
function isSandboxAgentCliPackage(packageName: string): boolean {
|
||||
return packageName === "@sandbox-agent/cli" || packageName.startsWith("@sandbox-agent/cli-");
|
||||
}
|
||||
|
||||
async function addNpmDistTag(
|
||||
packageName: string,
|
||||
version: string,
|
||||
tag: string,
|
||||
): Promise<void> {
|
||||
console.log(`==> Adding npm dist-tag: ${packageName}@${version} as ${tag}`);
|
||||
await $({
|
||||
stdio: "inherit",
|
||||
})`npm dist-tag add ${packageName}@${version} ${tag}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue