Files
lexical/scripts/npm/increment-version.js
Acy Watson e829a84f24 Automated releases (#2949)
* change to using package.json in root as pinned version

* wip automated release workflow with manual triggerl

* change release script

* Fix build script

* checkout new branch

* release on push to next

* no accidental releases

* release on push to latest

* fix yaml

* fix yaml

* fix yaml

* remove unnecessary

* remove unnecessary

* prettier
2022-09-08 16:46:53 -06:00

30 lines
843 B
JavaScript

#!/usr/bin/env node
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';
const {exec} = require('child-process-promise');
const argv = require('minimist')(process.argv.slice(2));
const increment = argv.i;
const validIncrements = new Set(['minor', 'patch', 'prerelease']);
if (!validIncrements.has(increment)) {
console.error(`Invalid value for increment: ${increment}`);
process.exit(1);
}
async function incrementVersion(increment) {
const preId = increment === 'prerelease' ? '--preid next' : '';
const workspaces = '';
const command = `npm version ${increment} --include-workspace-root true ${preId} ${workspaces}`;
await exec(command);
}
incrementVersion(increment);