mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
feat: Use PAT for gemini-cli-robot in release workflows (#9804)
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
This commit is contained in:
@@ -36,9 +36,35 @@ run(`npm version ${versionType} --no-git-tag-version --allow-same-version`);
|
||||
|
||||
// 3. Get all workspaces and filter out the one we don't want to version.
|
||||
const workspacesToExclude = [];
|
||||
const lsOutput = JSON.parse(
|
||||
execSync('npm ls --workspaces --json --depth=0').toString(),
|
||||
);
|
||||
let lsOutput;
|
||||
try {
|
||||
lsOutput = JSON.parse(
|
||||
execSync('npm ls --workspaces --json --depth=0').toString(),
|
||||
);
|
||||
} catch (e) {
|
||||
// `npm ls` can exit with a non-zero status code if there are issues
|
||||
// with dependencies, but it will still produce the JSON output we need.
|
||||
// We'll try to parse the stdout from the error object.
|
||||
if (e.stdout) {
|
||||
console.warn(
|
||||
'Warning: `npm ls` exited with a non-zero status code. Attempting to proceed with the output.',
|
||||
);
|
||||
try {
|
||||
lsOutput = JSON.parse(e.stdout.toString());
|
||||
} catch (parseError) {
|
||||
console.error(
|
||||
'Error: Failed to parse JSON from `npm ls` output even after `npm ls` failed.',
|
||||
);
|
||||
console.error('npm ls stderr:', e.stderr.toString());
|
||||
console.error('Parse error:', parseError);
|
||||
process.exit(1);
|
||||
}
|
||||
} else {
|
||||
console.error('Error: `npm ls` failed with no output.');
|
||||
console.error(e.stderr?.toString() || e);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
const allWorkspaces = Object.keys(lsOutput.dependencies || {});
|
||||
const workspacesToVersion = allWorkspaces.filter(
|
||||
(wsName) => !workspacesToExclude.includes(wsName),
|
||||
@@ -76,6 +102,8 @@ if (cliPackageJson.config?.sandboxImageUri) {
|
||||
}
|
||||
|
||||
// 6. Run `npm install` to update package-lock.json.
|
||||
run('npm install');
|
||||
run(
|
||||
'npm install --workspace packages/cli --workspace packages/core --package-lock-only',
|
||||
);
|
||||
|
||||
console.log(`Successfully bumped versions to v${newVersion}.`);
|
||||
|
||||
Reference in New Issue
Block a user