Releasing: Utilizing Github Actions and Tagging for release. (#2852)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
matt korwel
2025-07-03 22:57:01 -05:00
committed by GitHub
parent 32db5ba0e1
commit d43ea268b0
20 changed files with 811 additions and 179 deletions

View File

@@ -0,0 +1,51 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
// ES module equivalent of __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const rootDir = path.resolve(__dirname, '..');
function copyFiles(packageName, filesToCopy) {
const packageDir = path.resolve(rootDir, 'packages', packageName);
if (!fs.existsSync(packageDir)) {
console.error(`Error: Package directory not found at ${packageDir}`);
process.exit(1);
}
console.log(`Preparing package: ${packageName}`);
for (const [source, dest] of Object.entries(filesToCopy)) {
const sourcePath = path.resolve(rootDir, source);
const destPath = path.resolve(packageDir, dest);
try {
fs.copyFileSync(sourcePath, destPath);
console.log(`Copied ${source} to packages/${packageName}/`);
} catch (err) {
console.error(`Error copying ${source}:`, err);
process.exit(1);
}
}
}
// Prepare 'core' package
copyFiles('core', {
'README.md': 'README.md',
LICENSE: 'LICENSE',
'.npmrc': '.npmrc',
});
// Prepare 'cli' package
copyFiles('cli', {
'README.md': 'README.md',
LICENSE: 'LICENSE',
});
console.log('Successfully prepared all packages.');