Files
gemini-cli/scripts/prepare-github-release.js
T
mkorwel 2513dd929d revert(ci): Remove incorrect .npmrc creation from prepare-github-release.js
Reverts the change that added .npmrc creation logic to 'scripts/prepare-github-release.js'.

This logic was incorrectly overwriting the .npmrc file that is correctly configured by the 'Configure npm for GitHub Packages' step in the 'build-and-publish.yml' workflow, leading to authentication failures during npm publish.

The workflow itself already handles the .npmrc creation correctly, and this revert ensures that the correct authentication token is preserved.
2025-10-22 00:46:39 -07:00

42 lines
1.2 KiB
JavaScript

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'node:fs';
import path from 'node:path';
const rootDir = process.cwd();
function updatePackageJson(packagePath, updateFn) {
const packageJsonPath = path.resolve(rootDir, packagePath);
if (!fs.existsSync(packageJsonPath)) {
console.error(`Error: package.json not found at ${packageJsonPath}`);
process.exit(1);
}
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
updateFn(packageJson);
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
console.log(`Updated ${packagePath}`);
}
console.log('Preparing packages for GitHub release...');
// Update root package.json
updatePackageJson('package.json', (pkg) => {
pkg.name = '@google-gemini/gemini-cli';
});
// Update @google/gemini-cli-a2a-server
updatePackageJson('packages/a2a-server/package.json', (pkg) => {
pkg.name = '@google-gemini/gemini-cli-a2a-server';
});
// Update @google/gemini-cli-core
updatePackageJson('packages/core/package.json', (pkg) => {
pkg.name = '@google-gemini/gemini-cli-core';
});
console.log('Successfully prepared packages for GitHub release.');