mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-14 19:49:27 +00:00
Fix release script
This commit is contained in:
@@ -4,16 +4,36 @@
|
||||
|
||||
const execSync = require('child_process').execSync;
|
||||
|
||||
const version = process.argv.slice(2)[0];
|
||||
const args = process.argv.slice(2);
|
||||
const version = args[0];
|
||||
const skipGit = args[1] === '--skip-git';
|
||||
|
||||
const releaseCommands = [
|
||||
// use lerna to bump versions and dependencies
|
||||
`./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes`
|
||||
];
|
||||
|
||||
if (!skipGit) {
|
||||
releaseCommands.push(
|
||||
...[
|
||||
// add changes
|
||||
'git add .',
|
||||
// commit
|
||||
`git commit -m "${version}"`,
|
||||
// tag
|
||||
`git tag -m ${version} "${version}"`
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// publish to npm
|
||||
releaseCommands.push('cd packages/babel-plugin-react-native-web && npm publish');
|
||||
releaseCommands.push('cd ../react-native-web && npm publish');
|
||||
|
||||
if (!skipGit) {
|
||||
// push to github
|
||||
releaseCommands.push('git push --tags origin master');
|
||||
}
|
||||
|
||||
console.log(`Publishing ${version}`);
|
||||
// use lerna to bump versions and dependencies
|
||||
execSync(`./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes`);
|
||||
// add changes
|
||||
execSync('git add .');
|
||||
// commit and tag
|
||||
execSync(`git commit -m "${version}" && git tag -m ${version} "${version}"`);
|
||||
// publish to npm
|
||||
execSync('yarn publish');
|
||||
// push to github
|
||||
execSync('git push --tags origin master');
|
||||
execSync(releaseCommands.join(' && '));
|
||||
|
||||
Reference in New Issue
Block a user