mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-27 08:13:46 +00:00
Patch release script
Disable husky on version commit. Current publish script doesn't account for attempts to republish the same version.
This commit is contained in:
+14
-21
@@ -8,32 +8,25 @@ const args = process.argv.slice(2);
|
|||||||
const version = args[0];
|
const version = args[0];
|
||||||
const skipGit = args[1] === '--skip-git';
|
const skipGit = args[1] === '--skip-git';
|
||||||
|
|
||||||
const releaseCommands = [
|
console.log(`Publishing ${version}`);
|
||||||
// use lerna to bump versions and dependencies
|
|
||||||
`./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes`
|
// use lerna to bump versions and dependencies
|
||||||
];
|
execSync(`./node_modules/.bin/lerna publish --skip-git --skip-npm --repo-version ${version} --yes`);
|
||||||
|
|
||||||
if (!skipGit) {
|
if (!skipGit) {
|
||||||
releaseCommands.push(
|
// add changes
|
||||||
...[
|
execSync('git add .');
|
||||||
// add changes
|
// commit
|
||||||
'git add .',
|
execSync(`git commit -m "${version}" --no-verify`);
|
||||||
// commit
|
// tag
|
||||||
`git commit -m "${version}"`,
|
execSync(`git tag -m ${version} "${version}"`);
|
||||||
// tag
|
|
||||||
`git tag -m ${version} "${version}"`
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// publish to npm
|
// publish to npm (expect plugin to error as version won't change often)
|
||||||
releaseCommands.push('cd packages/babel-plugin-react-native-web && npm publish');
|
execSync('cd packages/react-native-web && npm publish');
|
||||||
releaseCommands.push('cd ../react-native-web && npm publish');
|
execSync('cd packages/babel-plugin-react-native-web && npm publish');
|
||||||
|
|
||||||
if (!skipGit) {
|
if (!skipGit) {
|
||||||
// push to github
|
// push to github
|
||||||
releaseCommands.push('git push --tags origin master');
|
execSync('git push --tags origin master');
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Publishing ${version}`);
|
|
||||||
execSync(releaseCommands.join(' && '));
|
|
||||||
|
|||||||
Reference in New Issue
Block a user