diff --git a/packages/build/src/npm-packages/bump.ts b/packages/build/src/npm-packages/bump.ts new file mode 100644 index 000000000..38f3f03b5 --- /dev/null +++ b/packages/build/src/npm-packages/bump.ts @@ -0,0 +1,13 @@ +import { spawnSync } from '../helpers'; +import { PROJECT_ROOT } from './constants'; + +export function bumpNpmPackages() { + spawnSync('npm', ['run', 'bump-packages'], { + stdio: 'inherit', + cwd: PROJECT_ROOT, + encoding: 'utf8', + env: { + ...process.env, + }, + }); +} diff --git a/packages/build/src/npm-packages/index.ts b/packages/build/src/npm-packages/index.ts index 4d4931001..c41ed52be 100644 --- a/packages/build/src/npm-packages/index.ts +++ b/packages/build/src/npm-packages/index.ts @@ -1 +1,2 @@ export { publishNpmPackages } from './publish'; +export { bumpNpmPackages } from './bump'; diff --git a/packages/build/src/release.ts b/packages/build/src/release.ts index 2777990c8..b316f0d0a 100644 --- a/packages/build/src/release.ts +++ b/packages/build/src/release.ts @@ -14,7 +14,7 @@ import { } from './evergreen'; import { GithubRepo } from '@mongodb-js/devtools-github-repo'; import { publishToHomebrew } from './homebrew'; -import { publishNpmPackages } from './npm-packages'; +import { bumpNpmPackages, publishNpmPackages } from './npm-packages'; import { runPackage } from './packaging'; import { runDraft } from './run-draft'; import { runPublish } from './run-publish'; @@ -54,6 +54,12 @@ export async function release( redactConfig(config) ); + if (command === 'bump') { + // updates the version of internal packages to reflect the tagged one + bumpNpmPackages(); + return; + } + const octokit = new Octokit({ auth: config.githubToken, });